Skip to Content
avatar image
Former Member

Problem in Drop down list creation (index method)

Hi ,

Can anyone please tell me how to create list drop down box by index method ?

For DropDownIndx : I have done this

Define a node (named 'TEXT') with cardinality '0..n' with attribute ('TEXT').

Create a UI element DropDownIndx

Bind the text property of DropDownbyIndex UI element to attribute Text of context node Text.

Regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jun 05, 2007 at 02:02 PM

    And what is your problem? No selections possible?

    Did you fill the node iwth elements? 😊

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Dipendra,

      You can populate the values in your dropdown by using the method set_attribute_value_set.

      Get the node_info of your context node by using node->get_node_info( ), and use the call

      node_info->set_attribute_value_set( attribute name, list of values ).

      In your case it would be city/country as the attribute name. Then bind the selectedKey property of the drop down to your context attribute. Hope this helps.

      Regards,

      Nithya

  • Jun 06, 2007 at 04:45 AM

    Hi,

    You have already created a node 'TEXT' with cardinality '0..n' with attribute TEXT. Bind the text property of DropDownbyIndex UI element to attribute Text of context node Text.

    For populating the values to the node text;

    In the WDDOINIT method you can prepare an internal table with the values and bind it to the node and the lead selection defines the selected element.

    The below code sample may help.

    method WDDOINIT .

    • for populating the values in drop down

    data:

    node_text type ref to if_wd_context_node,

    stru_text type if_componentcontroller=>element_text,

    tab_text type if_componentcontroller=>elements_text .

    node_text = wd_context->get_child_node( name = if_componentcontroller=>wdctx_text ).

    • Set/fill your values

    stru_text-text = 'Value1'.

    append stru_text to tab_text.

    stru_text-text = 'Value2'.

    append stru_text to tab_text.

    • set values to the node

    call method node_ddi_also_text->bind_table

    exporting

    new_items = tab_text.

    endmethod.

    for reading the values which user has selected in dropdown; for reading the selected index you can write the logic/method for the Onselect event of dropdownbyindex ui element. in the method read the attribute of the node text. the lead selection of the node gives the selected element (you can use the code wizard to read the context).

    Best regards,

    Suresh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 06, 2007 at 06:29 AM

    hai ,

    To my knowledge while using dropdownbyidx,you need to populate the vaue using the dataelement attached to that variable.

    All you need to do is create a data element and attach it to the attribute of your node.

    while creating the data element you attach a domain for which you declare the valur range of the vaues you want and that vaues get populated automatically in your dropdon box.

    note:this can be done if you r usibg dropdownbyidx only

    Cheers,

    Madhu

    Add comment
    10|10000 characters needed characters exceeded