How to set a value to a dynamically created node/attribute?

Hi,
I dynamically created attributes using the following method,
IWDNodeInfo cbOptions = wdContext.getNodeInfo().addChild("cbOpt"+count, null, true, true, false, false, false, true, null, null, null);
cbOptions.addAttribute("opt"+critEle.getQuest_Critid(), "ddic:com.sap.dictionary.string");
How do i assign a  value to it now, since the node/attribute cannot be accessed via wdcontext?
On a side note, it seems really troublesome if i need to use a checkbox grp(s) dynamically. I actually need to dynamically create a seperate node + attribute for each checkbox grp i have. Is there any better way to do this?
Thanx in advance

Hi
Steps:
1) Create the  action click is done statically (you cannot create action dyanmically)
2) binding the  action click to checkbox dynamically 
code
public static void wdDoModifyView(IPrivateDynamicProgrammingView wdThis, IPrivateDynamicProgrammingView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
    //@@begin wdDoModifyView
     if(firstTime){
                  IWDTransparentContainer con=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
          IWDCheckBox checkBox=(IWDCheckBox)view.createElement(IWDCheckBox.class,"ck");
          IWDAction act=wdThis.wdCreateAction(IPrivateDynamicProgrammingView.WDActionEventHandler.CLICK,"");
          checkBox.setOnToggle(act);
          con.addChild(checkBox);
    //@@end
Thanks and Regards,
Arun

Similar Messages

  • How get context value form a dynamic created node

    Hi all,
    I have build my own dynamic view. In this view I use also a dynamic created Node. When I have more rows in my Node I see every row with context of the last row of the dynamic Node.
    this is the source I use.
    for (int x = 0; x < dynTabNode.size(); x++)
      dynTabNode.setLeadSelection(x);
      IWDGroup group = (IWDGroup)view.getElement("Group_name");
      IWDAttributeInfo aiName = wdContext.getChildNode("DayNode", IWDNode.LEAD_SELECTION).getNodeInfo().getAttribute("Name");
      IWDCaption name = (IWDCaption) view.createElement(IWDCaption.class, null);
      name.bindText(aiName);
      group.addChild(name);
      for (int i = 8; i < 18; i++)
        int teller = i * 100;
        IWDGroup group1 = (IWDGroup)view.getElement("hour" + teller);
        for (int z = 0; z < 12; z++)
          IWDImage image = (IWDImage) view.createElement(IWDImage.class, "Image" + teller + "_" + x);
          image.setWidth("10");
          image.setHeight("24px");
          image.setBorder(0);
          IWDAttributeInfo att = dynTabNode.getNodeInfo().getAttribute("hour" + teller);
          image.bindSource(att);
          group1.addChild(image);
          teller = teller + 5;
    How can I read my Node row for row?
    Richard
    Edited by: Armin Reichert on Jul 28, 2008 5:03 PM

    The reason is that all these Caption UI elements are bound against the same context attribute. At runtime this will be resolved to the attribute value of the lead-selected node element. In this example you can fix this by not binding the "text" property but setting it to the attribute value of the iterated node element:
    for (int x = 0; x < dynTabNode.size(); x++)
      dynTabNode.setLeadSelection(x);
      IWDGroup group = (IWDGroup)view.getElement("Group_name");
      IWDCaption name = (IWDCaption) view.createElement(IWDCaption.class, null);
      IWDNode dayNode = wdContext.getChildNode("DayNode", IWDNode.LEAD_SELECTION);
      String text = (String) dayNode.getElementAt(x).getAttributeValue("Name");
      name.setText(text);
      IWDAttributeInfo aiName = dayNode.getNodeInfo().getAttribute("Name");
      name.bindText(aiName);
      group.addChild(name);
    (I assume here that the node "DayNode" has the same size as dynTabNode. No idea if this assumption is correct)
    But this would not help for editable elements where you need to bind the edited property.
    Armin

  • ADF 11g + How to capture the value of a dynamically created input text box

    Hi All,
    I have a requirement where, on selection of the value in a drop down, the input text boxes need to get dynamically populated on the JSPX page. I'm able to bring this functionality, and it is working fine.
    But the challenge right now I'm facing is that, how to read/capture the value entered in those dynamic text boxes on submission of the page. Please help me in getting this resolved.
    Below is the code snippet I'm using for this.
    // Clearing the existing input fields in the Panel form
    while (pf100.getChildren().iterator().hasNext()) {
    pf100.getChildren().remove(pf100.getChildren().iterator().next());
    // Creating the new fields based on the number of IP addresses selected
    for (int i = 0; i < iIPAddress; i++) {
    RichInputText pcPreferredDomain = new RichInputText();
    pcPreferredDomain.setLabel("Preferred Domain / Hostname for Desktop PC/ Laptop - " +
    (i + 1));
    pcPreferredDomain.setColumns(40);
    pcPreferredDomain.setId("pcpfdomain" + (i + 1));
    pf100.getChildren().add(pcPreferredDomain);
    Thanks All in Advance,
    Thanks & Regards,
    Dharmathej M

    As per your method, you are creating the RichInputText components as local variables.
    What happens when you are creating them as class level variables in the managed bean, if you do so, you can refer to the values of the UI components in the actionListener/action code for the command button in the managed bean
    sample:
    public class ManagedBean{
    RichInputText [] pcPreferredDomain;
    public ManagedBean(){
    // Clearing the existing input fields in the Panel form
    while (pf100.getChildren().iterator().hasNext()) {
    pf100.getChildren().remove(pf100.getChildren().iterator().next());
    pcPreferredDomain = new RichInputText[iIPAddress];
    // Creating the new fields based on the number of IP addresses selected
    for (int i = 0; i < iIPAddress; i++) {
    pcPreferredDomain[i] = new RichInputText();
    pcPreferredDomain.setLabel("Preferred Domain / Hostname for Desktop PC/ Laptop - " +
    (i + 1));
    pcPreferredDomain.setColumns(40);
    pcPreferredDomain.setId("pcpfdomain" + (i + 1));
    pf100.getChildren().add(pcPreferredDomain);
    Thanks,
    Navaneeth

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • How to set cookie value in one page and retrieve in another page using setA

    How to set cookie value in one page and retrieve in another page using setActionListener?
    I have tried with following code srcpage.jspx->destpage.jspx
    srcpage.jspx
    <af:table value="#{bindings.DepartmentsView1.collectionModel}"
    var="emp" rows="#{bindings.EMPView1.rangeSize}"
    first="#{bindings.EMPView1.rangeStart}"
    emptyText="#{bindings.DepartmentsView1.viewable ? 'No rows yet.' : 'Access Denied.'}">
    <af:column sortProperty="EmployeeName" sortable="false"
    headerText="Cookie Testing">
    <af:commandLink text="#{emp.EmployeeName}" action="success">
    <af:setActionListener from="#{emp.EmployeeName}"
    to="#{cookie}"/>
    </af:commandLink>
    </af:column>
    </af:table>
    espage.jspx
    <af:outputText value="Test Cookie Value: #{cookie}"/>
    ,Here Test Cookie Value prints the following instead of its original String value
    {JSESSIONID=javax.servlet.http.Cookie@7da288, oracle.uix=javax.servlet.http.Cookie@399f62}
    I have passed employee name "Robert" to cookie in srcpage.jspx,but it prints "JSESSIONID....." instead of "Robert" in destpage.jspx
    Thanks in advance
    Kalee

    Hi,
    "cookie" is a reserved name. If you want to write to a session scope attribute called "cookie" then you have to call #{sessionScope.cookie}. If you want to use EL to set and read from cookies then you will have to use
    #{cookie.cookieName}
    Note that #{cookie} writes to and returns a map
    check this: http://www.informit.com/articles/article.aspx?p=30946&seqNum=7
    Frank

  • How to set variable value in an XML array

    Hi,
    Please let me know how to set the value for a xml array element using assign activity inside a for-each block in BPEL 11g
    I tried to set the variable value for result element using the below condition but i encountered selection failure message
    $outputVariable.payload/ns1:Student['i']/ns1:result or
    $outputVariable.payload/ns1:Student[$i]/ns1:result
    And the xsd used is as below
    <xsd:complexType name="StudentCollection">
    <xsd:sequence>
    <xsd:element name="Student" type="Student" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="Student">
    <xsd:sequence>
    <xsd:element name="Name" type="xsd:string"/>
    <xsd:element name="location" type="xsd:string"/>
    <xsd:element name="mark" type="xsd:string"/>
    <xsd:element name="result" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    Thanks,
    Dhana

    Hi,
    At the back of button specify the following parameter:-
    CMD    1        Execute_planning_function
    Planning_function_name  1   xyz
    Var_name     1    variable_name
    var_value      1    blank
    Can also refer to link below:-
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0a89464-f697-2910-2ba6-9877e3088954?quicklink=index&overridelayout=true(can refer to page 20)
    http://www.sdn.sap.com/ddc5564a-337d-4cf9-a34e-2dab64df09be/finaldownload/downloadid-a61a6724ba8e7b7fbd9c5df9590ab50d/ddc5564a-337d-4cf9-a34e-2dab64df09be/irj/scn/go/portal/prtroot/docs/library/uuid/f0881371-78a1-2910-f0b8-af3e184929be?quicklink=index&overridelayout=true
    Hope it may help

  • In flex, How to set a value to one parameter, the parameter defined in a cffunction in a cfc file

    In flex, How to set a value to one parameter, the parameter
    defined in a cffunction in a cfc file, In the cffunction there are
    much cfargument, I want set a value to one of them, such as the
    cfc:
    <cffunction access="remote" name="myShow" output="false"
    returntype="struct">
    <cfargument name="ID" type="numeric" default=0>
    <cfargument name="GoodsID" type="string" default="">
    <cfargument name="DestTime" type="string" default="">
    <cfargument name="DestCount" type="numeric" default=1>
    How I set a value to only parameter one of them , such as set
    GoodsID when use mx:remoteObject.
    Thanks for your help

    Got maybe a solution for you, I have just tested it.
    So, the idea is to use intermediate variables. Imagine Var1 and Var2 variables that you refresh with your more or less complicated queries. Then what you can do is to refresh your final variable Var3 with a query using your intermediate variables. Here is an example for Oracle:
    select #Var1+#Var2 from dual
    This way you can make a chain of dependent variables: Var3 is using Var2 and Var2 is using Var1.
    Hope it helps.
    Shamil

  • How to set the cardinality property as 1..n for a dynamically created node

    Hi...everybody
        I am creating Dropdown by index UI element and the
    context atrributes dynamically.To bind multiple data to a dropdown
    the cardinality property of the node should be 0..n or 1..n,
    But i could not set the property of the dynamically created context node to 0..n ...
    can any body suggest me..
    I implemented the following code in WDDoModify View
    IWDTransparentContainer tc=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
    IWDNodeInfo node = wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,
              null,null);
    IWDAttributeInfo strinfo=node.addAttribute("Value","ddic:com.sap.dictionary.string");
    dbyindex.bindTexts(strinfo);
    tc.addChild(dbyindex);
    I could successfully display one value in the drop down,by adding the following code before the line tc.addchild(dbyindex);
    IWDNode node1=wdContext.getChildNode("DynamicNode",0);
    IWDNodeElement nodeElement=node1.createElement();
    nodeElement.setAttributeValue("Value","Hello");
    node1.addElement(nodeElement);
    but when
    i am trying to bind multiple values i am getting Exception ,,,,

    hi
    you are getting the exception because of cardinality property.
    i.e   true,false and
    you are trying to add morethan one element.
    so,if you want to add morethan one than one element you have to set the cardinality property to true,true (or) false,true.
    In your code do the following modification for changing the cardinality.
    For 0..n -->false,true
          1..n-->true,true
    IWDTransparentContainer tc=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
    IWDNodeInfo node = wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,
    null,null);
    IWDAttributeInfo strinfo=node.addAttribute("Value","ddic:com.sap.dictionary.string");
    dbyindex.bindTexts(strinfo);
    tc.addChild(dbyindex);
    hope this will solve your problem.
    In addchild(..) the parameters are
    addChild("Name ,
                    Element class for model node ,
                    Is singleton? ,
                    Cardinality ,
                    Selection cardinality ,
                    Initialise lead selection? ,
                    Datatype ,
                    Supplier function ,
                     Disposer function);
    Regards
    sowmya

  • How to set the value of something in a component from the main application?

    Hi,
    Maybe I've been working on this too long, but I can't figure
    out how to set the value of the text property of a text input field
    in a component from my main application in an mx:Script block. I
    have a component called Login in the components folder, and I need
    to set the text value of empNum. In my mxml declaration at that the
    top, I've declared these components as xmlns:c="components.*" So
    logically, the property I'm trying to set is c.Login.empNum.text. I
    can't figure out the correct syntax to get this to work, and I've
    tried everything I can think of. Does anyone have any suggestions?
    I'm thinking this should be an easy one, and I'm just missing
    something.
    Thanks!
    Holli

    Did you try giving it an id ?
    <c:MyLogin id="loginScreen" /c>
    So later you can do loginScreen .empNum.text = "my text"
    Laurent,

  • How to set the value of process variables/payload using a managed bean?

    Hello,
    Someone can give me an example about how to set the values of a process payload in a managed bean?
    thank you!

    Try this:
    jsf page:
    <af:selectOneChoice label="Select Suburb"
    requiredMessageDetail="Select a suburb"
    valueChangeListener="#{selectOneChoiceBean.onValueChanged}"
    validator="#{selectOneChoiceBean.validate}"
    unselectedLabel="None" autoSubmit="true"
    binding="#{selectOneChoiceBean.selectOneChoice}"
    value="#{selectOneChoiceBean.value}">
    <f:selectItems value="#{selectOneChoiceBean.selectionList}"/>
    </af:selectOneChoice>
    backing bean:
    public class SelectChoiceBean {
    private List<SelectItem> selectionList;
    private String value = "B";
    private RichSelectOneChoice selectOneChoice;
    public SelectChoiceBean() {
    initSelectionList();
    public void setSelectionList(List<SelectItem> selectionList) {
    this.selectionList = selectionList;
    public List<SelectItem> getSelectionList() {
    return selectionList;
    public void onValueChanged(ValueChangeEvent valueChangeEvent) {
    System.out.println(valueChangeEvent.getNewValue());
    // Add event code here...
    public void validate(FacesContext facesContext, UIComponent uIComponent,
    Object object) {
    // Add event code here...
    private void initSelectionList() {
    selectionList = new ArrayList<SelectItem>();
    selectionList.add(new SelectItem("A", "A label"));
    selectionList.add(new SelectItem("B", "B label"));
    selectionList.add(new SelectItem("C", "C label"));
    public void setValue(String value) {
    this.value = value;
    public String getValue() {
    return value;
    public void setSelectOneChoice(RichSelectOneChoice selectOneChoice) {
    this.selectOneChoice = selectOneChoice;
    public RichSelectOneChoice getSelectOneChoice() {
    return selectOneChoice;
    }

  • How to set the Value in Dropdownbyindex

    Hi Experts,
    I am New to Webdynpro-ABAP.
    I have one Dropdownbyindex field. I need to set the value from BAPI. how to set that values in Dropdown..
             I need Basic step-by-step procedure.
    Regards,
    P.Manivannan

    Hi,
    1. First import the BAPI in to WD component using create->service call.
    2.The BAPI import, export and Table parameters will be set in to the Component Controller context.Then drag this BAPI node to your view.
    3.In the 'texts' property of DDbyindex bind the BAPI output node which will be the Table parameter of the BAPI.It could be under CHANGING node.
    4.In WDDOINIT method just click the code wizard and enter the method name which you will give when importing the BAPI.Automatically the values from the BAPI will be loaded into your Dropdown when you run the application.
    Regards,
    Dinesh

  • How to set the value in SelectOneChoice

    Hi,
    I need an help....
    can anyone please tell me how to set the value in SelectOneChoice.
    I want to set the value at index 3
    i am trying selectOneChoice1.setvalue(new Integer(3)); but it is throwing an NullPointerException.
    Thanks,
    Neha

    Hi,
    is it ADF bound? If so then you set the default value to the list binding in the PageDef file. The value of the component must be bound to a method expression, which is why you see an exception. However, I think we need more information
    Frank

  • How to set variables values via VBA.

    Anybody please help.
    How to set variables values via VBA in workbook. SAP Netweaver 2004s.

    Pass variable values with VBA and BI 7.0 funtions to Query
    At first a remark u2013 Iu2019ve read a lot of threads saying that passing values to a query can be done by using VBA code only. Iu2019ve tested it but Iu2019m not sufficient with the new BEX 7.0 API and therefore I use a mixture of BEX 7.0 funtionality and VBA. I create a BEX 7.0 design item button passing the values to a query u2013 I hide this button somewhere on the sheet or on a hidden sheet and I then raise the event to click the button from VBA code. Works fine and the maintenance is easier if something changes in the API in the future again.
    How to start:
    Switch to design mode in BEX Analyzer:
    Implement a BEX 7.0 design item u201Cbuttonu201D
    Click on the button to implement the properties
    Make the input for the commands
    data_provider = dataprovider_1
    cmd = process_variables
    subcmd = var_submit
    No comes the part with the variables u2013 Letu2019s assume a query has 4 variables but you only want to change 1 with the button u2013 an organizational unit for instance.
    Make a range somewhere in the excel with the following structure:
    Name    Index   Value
    VAR_NAME_1      1       Variablename
    VAR_VALUE_EXT_1 1       variablevalue
    Value should contain the name of your variable of course and u201Cvalueu201D the value of your variable
    Set a name for this range with EXCEL functionality but without the header:
    Back to the properties of the button: Insert the name of the range with the variables in the field Command Range:
    If you have more variables to process you can of course enhance your Filterrange!
    In the left upper Corner you have a name for your button:
    Now you can raise the button-click in vba like this:
    Application.Run "'" & ThisWorkbook.Name & "'!Sheet2.BUTTON_35_Click"
    regards, Lars

  • How to set default values in initialization event for select option

    Abapers,
    I have 3 GL account like 0024831231,0024831238,0024831245.
    Please help me how to set default values in select-options ( s_hkont ) in INTIALIZATION event
    Thanks

    Select option is table <Structure> with fields, low, high, sign & option
    you need to append the value into the select option, with appropriate value in low or
    example:
    S_HKONT-low  = <value>
    S_HKONT-SIGN = 'I'
    S_hkont-OPTION = 'EQ'
    append s_hkont.
    Default value for select-option also can be added directly in select-option statement.
    Regards,
    Mahesh

  • How to set default values in dialog programming

    hi gurus
    can anyone suggest me
    how to set default values in dialog programming
    thanks&regards
    kals.

    it's a bit dirty but I usually just place it in the PBO with a flag for control. It's simple and not too costly i think.
    MODULE preRender OUTPUT.
      DATA first_time TYPE flag VALUE 'X'.
      IF first_time EQ 'X'.
    *   put your initialization code here
        CLEAR first_time.
      ENDIF.
    ENDMODULE.
    -MiR

Maybe you are looking for