Populate Values for Drop Down by Index in Table in Web Dynpro Java

Hi Experts,
I have a table and having a column table cell editor as Drop Down by Index.
I have created the table node (tbnode) and child node for DDBI (ddbinode) and set the singleton property for DDBI node to false.
I have same local variable node as same as above node and the values are available.
I have one button ADD.On click the add button i need to populate the values to table node and as well as DDBI Node.
I created supply function for DDBI node and populate the values for DDBI Node.
Add Method:
IPrivateMdTest8CompView.ItbnodeElement tbnode = wdContext.nodetbnode().createtbnodeElement();
tbnode.setDescription(wdContext.currentCn_LocalVariableElement().getDescription);
wdContext.nodetbnode().addElement(tbnode);
Supply Function Method:
for(int j=0;j<wdContext.nodetbnode().size();j++)
wdContext.nodeddbinode().setLeadSelection(j);
IPrivateMdTest8CompView.IddbinodeElement ddbinode = wdContext.nodeddbinode().createddbinodeElement();
ddbinode.setddvalue(wdContext.currentCn_localddvalueElement().getddvalue);
wdContext.nodeddbinode().addElement(ddbinode);
Problem is one i got the values in the drop down and i click the second row in table again the supply function calls and reset the first row drop down to original value.
If you any problem like please provide the solution.
Thanks & Regards,
SatheshKumar R

If you created the supply method by setting the supply property of the node, you should have variable 'node' available as argument of the supply method, which will be related to the table row of the triggered dropdown. Opening the dropdown does not change the lead selection of the parent node, so
ddbinode = wdContext.nodeddbinode().createddbinodeElement();
wdContext.nodeddbinode().addElement(ddbinode);
does always relate to the first row of the table (given that leadSelection == 0). With the node variable you can
IddbinodeElement ddbiElement = node.createddbinodeElement();
node.addElement(ddbiElement);

Similar Messages

  • Drop down in allready displaying table in web dynpro

    Hi Experts,
    We have  a requirement where we are displaying the data of the table KNA1 in a table form (Web dynpro) which is editable.for the field NAME1 there must be drop down box which contain some values , so that for any row user can select one of the value and then when press SAVE button the table KNA1 should be updated with the new value of NAME1.
    Can you please let us know how to do this.
    Thanks
    Mahesh

    >Can you please let us know how to do this.
    Which part of what you describe and what exactly are you having problems with.  You can of course change the cell editor of your column to DDLB.  Is that where you are having problems.  Or are you trying to decied between DDLBByKey and DDLBByIndex.  For that I would suggest you read the following:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/bb/69b441b0133531e10000000a155106/frameset.htm

  • How to capture selected value from drop down by index

    Dear friends,
    i want to capture the value of select value from drop down by index, for eg if  select air france, how to capture , could any one please let me know
    Thanks
    Vijaya

    Hi Vijaya,
    You can get the value of selected from drop down as below
    Check out the event handler method attached to Onselect event of the ui element drop down by index , if no event is associated, then create an event and attach to the drop down list
    Now you will be having the CONTEXT_ELEMENT in the WDEVENT parameter
                   data lo_element type ref to if_wd_context_element.
                   lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT').
    Now, you can get the static attribute value of selected  drop down value & let us say your drop down list values are populated from context node 'ND_DRP_DOWN'
                   data ls_data type wd_this->element_nd_drp_down.
                             lo_element->get_static_attributes(
                                       importing
                                       static_attributes = ls_data ).
    Hope this helps you.
    Regards,
    Rama

  • How to hard code values in drop down by index

    Hi everyone
    I hav a node containing 2 attributes ie value n key. I am using drop down by index.  Value attribute is bound to my drop dwn box. In key I am providing key value for the value.  I need to hard code 3 value..Can anyone help me how to do so.
    Thanks
    Jaspreet Kaur

    Hi,
    Example for Data Binding of the DropDownByIndex UI Element:
    Procedure at design time:
           1.      Create a view with the name TestView.
           2.      Insert the DropDownByIndex UI element as a container child of the TestView view. (Step 1)
           3.      Create the context structure, as described in step 2.
    Create the context node X with the cardinality 0..n. Insert the value attribute y of the type String into this node. Then perform the data binding of the DropDownByIndex UI element in the Properties window of the View Designer. The texts property must be bound to the value attribute y with the context path description TestView.X.y (step 3).
    The context path TestView.X.y describes the attribute y in the context node X of the view context of the TestView view.
    You can fill the context with test data using the following controller implementation.
    public void wdDoInit()
        //@@begin wdDoInit()
       String[] letters = new String []
       {"A", "B", "C", "D"};
    //Create context elements for the node "X"
       List nodeElements = new ArrayList();
       for (int i =  0; i <letters.length; ++i)
          IPrivateTestView.IXElement xElement = wdContext.createXElement();
          xElement.setY(letters<i>);
          nodeElements.add(xElement);
    //Bind node element list to the node
       wdContext.nodeX().bind(nodeElements);
    //Set node’s lead selection which determines the selected item
       wdContext.nodeX().setLeadSelection(1);
        //@@end
    Regards
    Ayyapparaj

  • How to add customized value to drop down by index binded to model attribute

    i have to Ui element Drop down by index to which i have binded model attribute for populating the values, now i want to add a customized value to it like "choose all".
    how can i do this ??
    Thanks and regards,
    Aditya Deshpande

    Create a value node similar to model node. In value node you can add element at the index wherever you want to:
    wdContext.node<nodename>().addElement(<index>,<element>);
    Regards,
    Murtuza

  • How to set default value for drop down box in jsf

    Hi,
    Can anyone help me to set the default value in drop down box using <af:selectManyChoice> ?
    As I know there is an unselectedLabel attribute in <af:selectOneChoice> but not valid attribute for <af:selectManyChoice>.
    Any help must be appreciated.
    Regards,
    AK

    Hi Frank
    My entity type is a List in managed bean. I have set the entityType in the constructor of the managed bean. I have attached my code here.
    TPSearchCriteriaBean.java****************************************
    /** Constructor */
    public TPSearchCriteriaBean() {
    super();
    entityType=new ArrayList<String>();
    entityType.add(UIConstants.LIST_ITEM_ALL);
    authorizationType=new ArrayList<String>();
    authorizationType.add(UIConstants.LIST_ITEM_ALL);
    companyType=new ArrayList<String>();
    companyType.add(UIConstants.LIST_ITEM_ALL);
    mrgStatus=new ArrayList<String>();
    mrgStatus.add(UIConstants.LIST_ITEM_ALL);
    legalStatus=new ArrayList<String>();
    setEntityType(entityType);
    setAuthorizationType(authorizationType);
    setCompanyType(companyType);
    setMrgStatus(mrgStatus);
    country = "0";
    //address = new AddressBean();
    UIConstants.java***********************************************************
    public static final String LIST_ITEM_DEFAULT = "select";
    public static final String LIST_ITEM_ALL = "0";
    LOVManager.java*****************************************************************
    public List<SelectItem> getLovList(String lovType, boolean requiredOption_SELECT, boolean requiredOption_ALL)
    log.debug("LOV loading for " + lovType + ": START");
    List<SelectItem> lovList = new ArrayList<SelectItem>();
    //check validity of lov loading request
    validLov:
    for (int i = 0; i < lovTypeArray.length; i++)
    if (lovTypeArray.equals(lovType))
    break validLov;
    log.debug("ERROR: LOV Type not valid.");
    return lovList;
    //First select is replaced by ALL here
    //<-- Select --> should be an option
    if (requiredOption_SELECT)
    lovList.add(new SelectItem(UIConstants.LIST_ITEM_DEFAULT, "--Select--"));
    LOVDao dao = new LOVDao();
    dao.loadLOVValues(lovType, lovList);
    log.debug("LOV Loading successful!");
    //<ALL> should be an option
    if (requiredOption_ALL)
    lovList.add(new SelectItem( UIConstants.LIST_ITEM_ALL, "ALL"));
    return lovList;
    Kindly help me.
    Regards,
    AK

  • Drop down by index  in table cell

    Hello
    I need for one column in table to have a drop down.
    I have the the following context:
    node: Zsi_Profile_TyperdvZish_Available_Timeslots_S_Rfc
    subnode: X
    value attribute in subnode X: a
    Node X is singelton = false, selection: 0-1.
    I am defined a drop down by index for one column and I want the data to come from node It_Rnpb2.
    The code:
    for (int i = 0; i< wdContext.nodeZsi_Profile_TyperdvZish_Available_Timeslots_S_Rfc().size();i++)
    wdContext.nodeZsi_Profile_TyperdvZish_Available_Timeslots_S_Rfc().getElementAt(i);
    for (int j = 0;j< wdThis.wdGetRendezVousCustomController().wdGetContext().nodeIt_Rnpb2().size();j++)
    wdContext.nodeX().addElement(wdContext.createXElement());
    wdContext.currentXElement().setA(wdThis.wdGetRendezVousCustomController().wdGetContext().nodeIt_Rnpb2().getIt_Rnpb2ElementAt(j).getOrgid());
    The result is: for first table line a drop down with few empty lines and one of the line with the last value from It_Rnpb2, and for the other table lines drop downs just with an empty line.
    How can I fix this?
    Thank you

    Let me change those ugly node names into shorter ones and use an array containing the drop-down items for each row. I think you get the idea.
    Table data source node: "Rows"
    Non-singleton child node "Items", cardinality 0:N, with attribute "Text".
    String TEXTS[][] with TEXT[r][j] = text of item j in row r
    /* foreach row in table */
    for (int r = 0; r < wdContext.nodeRows().size(); ++r)
      IRowsElement row = wdContext.nodeRows().getRowsElementAt(r);
      /* foreach drop-down list item */
      for (int j = 0; j < TEXTS[r].length; ++j)
        /* create item */
        IItemsElement item = row.nodeItems().createItemsElement();
        row.nodeItems().addElement(item);
        /* set item text */
        item.setText(TEXTS[r][j]);
    I typed this code from memory so there might be minor errors.
    Armin

  • Drop Down by Index in Table

    Hi
    I wish to have a drop down by index field in my table but only in certain cells in one particular row.
    Once the value has been chosen I wish to then colour the two cells above the drop down.
    Is this possible?
    Regards
    Ian

    Hello Ian,
    if the coloring was you only requirement, then there won't be a different between the ALV and the standard table in terms of coding. So this requirement should make the difference. Using ALV vs. standard table is usually decided on additional factors, like if users would like to use the additional options provided by ALV.
    Best regards,
    Thomas

  • Weblog for Simple way to debug ESS and MSS Web Dynpro Java applications

    Here is the link to the new Weblog topic "Simple way to debug ESS and MSS Web Dynpro Java applications"
    /people/yugandhar.reddy/blog/2011/03/26/simple-way-to-debug-ess-and-mss-web-dynpro-java-based-applications--very-useful-technique

    Thanks Siddharth. I was trying as you suggested, I was trying to add the link to the FAQ's but looks like the wiki is locked or I dont have permission to create a page in it. Is there any other way to do it?
    Edited by: Yugandhar  Reddy on Mar 28, 2011 5:04 PM

  • Subject: Drop Down By index Vs Key

    Question: I have domain with Fixed value and i want the drop down in webdynpro screen to pick  the domain value automatically
    what type of drop down should be used and can you differentiate the two types
    kindly reply

    Hi,
    You should use drop down by key in order to select the domain value automatically.
    Map your contxt attribute as a selected key property of the UI element property.
    Diff. b/w the two avalable types:
    For drop Down by index, You need to build the value table to the node intially and an intial value will be space by default.
    For drop Down by key: you have val-nam pair i.e if you can decide to display domain value or description.
    Hope this  may be helpful.
    Thank you
    Depeshl

  • Default value in the drop down by index

    Hi Experts,
    I have a drop down by index to which i binded one internal table,but m not able to get the default value
    i want the first value to be selected in the drop down by default,Pls give me suggestion for solving this problem

    Hi Shan,
    As per your requirement,When ur binding the internal table to the  drop down by index ,but your are not able to get the default value.
    For this please check this code.
    In this I hv taken a node - dropdown1 and within this attribute of type Land1 and I hv set the cardinality to 0..n.
    Then I hv bind the text property of the dropdownbyidx ui element to the node attribute.
    then i hv call this code in the init method of view.
    DATA lo_nd_dropdown1 TYPE REF TO if_wd_context_node.
      DATA lo_el_dropdown1 TYPE REF TO if_wd_context_element.
      DATA lt_dropdown1 TYPE wd_this->elements_dropdown1.
      DATA ls_dropdown1 LIKE LINE OF lt_dropdown1.
      navigate from <CONTEXT> to <DROPDOWN1> via lead selection
      lo_nd_dropdown1 = wd_context->get_child_node( name = wd_this->wdctx_dropdown1 ).
      @TODO handle not set lead selection
      IF lo_nd_dropdown1 IS INITIAL.
      ENDIF.
      get all declared attributes
      lo_nd_dropdown1->get_static_attributes_table(
        IMPORTING
          table = lt_dropdown1 ).
      SELECT land1 FROM t005 INTO CORRESPONDING FIELDS OF TABLE lt_dropdown1.
      CALL METHOD lo_nd_dropdown1->bind_table
        EXPORTING
          new_items            = lt_dropdown1
          set_initial_elements = abap_true .
    Regards
    Manoj Kumar

  • How can I add values on a Drop Down by Index Webdynpro Element?

    Hi every body
    Can anybody help me?
    How can I add values on a Drop Down by Index Webdynpro Element?
    How can I invoque my element on the Implementation Webdynpro?

    Hi Jesus,
    You can add elements to your DDbyIndex like this:
    //Example: Popular un Dropdown by Index usando Nodos de contexto  
    // NODE[Card: 1..n, Sele:1..1]  Si es obligatorio;            ||    NODE[Card: 0..n, Sele:0..1]  Si no es obligatorio y se puede dejar en blanco
    //Assuming we created a node called "Source", with a string attribute called "Texto" binded to the dropdownbyindex
    for (int i = 1; i <= 101; i++)
         ISourceElement sourceElement = wdContext.createSourceElement();
           sourceElement.setTexto("Text number "+i);
           wdContext.nodeSource().addElement(sourceElement);
    Regards.
    Julio Herrera

  • How can I add values on a Drop Down by Index Webdynpro Element by a Model?

    How can I add values on a Drop Down by Index Webdynpro Element with a Model RFC?

    Hi Jesus,
    Please use the below code for DropDownByIndex Elements :-
    Suppose you have model node ABC and attribute xyz. Now you have created custom node CustNode and attribute CustAtt.
    ICustNodeElement  ele = null;
    if(wdContext.nodeABC().size > 0)
                  for(int i=0; i< CustNode< wdContext.nodeABC().size; i++
         ele = wdContext. createCustNode();
                          ele.setCustAtt(wdContext.nodeABC().getABCElementAt(i).getXYZ)
         wdContext.nodeCustNode.add(ele);
    Refer to http://help.sap.com/saphelp_nw70/helpdata/en/3b/f1754276e4c153e10000000a1550b0/frameset.htm
    Best Regards
    Arun Jaiswal

  • In Drop Down by Index how can i pass default value Dynamically

    Hi Friends,
    In Drop Down by Index how can i pass default value Dynamically.Please help me.
    Thanks in advance.
    Regards,
    Kumar.

    hi,
    if you want the value to be defaulted only the first time you execute the program then write the code which suman has mentioned in the views method
    wddoinit.
    Regards
    Sajid

  • Not able to set values in drop down for a table field

    Hi All,
    I am not able to set values in drop down for a table field. Although I am able to set these values to a stand alone field but its not happening for a particular table field. I am using ABAP web dynpro for coding.
    Pls help.
    Regards,
    Bhaskar

    Hi Otto,
    Here is the code I am using:
    * navigate from <CONTEXT> to <DATASOURCE> via lead selection
      lo_nd_datasource = wd_context->get_child_node( name = wd_this->wdctx_datasource ).
    * navigate from <DATASOURCE> to <CHANGING_PARAM> via lead selection
      lo_nd_changing_param = lo_nd_datasource->get_child_node( name = wd_this->wdctx_changing_param ).
    * navigate from <CHANGING_PARAM> to <EDUCATION_TAB> via lead selection
      lo_nd_education_tab = lo_nd_changing_param->get_child_node( name = wd_this->wdctx_education_tab ).
      node_info = lo_nd_education_tab->get_node_info( ).
      REFRESH ddlb_value_set.
      DATA: wa_edu_est TYPE t517t.
      SELECT * FROM t517t INTO wa_edu_est WHERE sprsL = 'EN'.
        s_element-text = wa_edu_est-stext.
        s_element-value = wa_edu_est-slart.
        APPEND s_element TO ddlb_value_set.
      ENDSELECT.
      SORT ddlb_value_set BY text.
    *    Set Value_sets to node_info
      node_info->set_attribute_value_set(
         name      = 'EDU_EST'
         value_set = ddlb_value_set ).
    Regards,
    Bhaskar

Maybe you are looking for

  • Generally positive impression...

    After some frustration with Firefox, I decided to try Safari for the first time. I'm a PC user because I like to tinker (in fact, am a professional tinkerer), and demand a computer conforms to me rather than the other way around. Consequently, a Mac

  • Why does it take 3 clicks to open a file in the Bridge CS5?

    At first I thought my tablet was going bad, but after experimenting I realized that if I select the Bridge icon in the CS5 programs, the Bridge does indeed come to the forefront as one would think, however...you must click in the window first apparen

  • Page loads in one user accnt, but not another

    I thought this was a flash problem, so posted with that premise yesterday. I am posting again with new context: 17" MacBook Pro, 10.6.4, Safari 5.0, Firefox 3.6, Chrome, HD about 60% full, lots of RAM. My MBP has two user accnts: 1. MyHome - daily us

  • How to display a record count in a text field?

    I am trying to return a record count of a query and place that count in a text field on my search page in APEX. I have that text field defined under Items on the search page. How do I get a query record count to display in my text field? Thanks, John

  • TS4268 IMESSAGE NOT CONVERTING TO SMS

    I phone says imessage sent. non iphone user has not recieved message. imessage not converting to sms. turned imessage off, reset netwrk setting, turned on imessage, still not working.