on 06-26-2007 1:48 PM
Hi,
How to get the table values in the dropdown list. how to bind it. could you please explain me how to do this along with code.
Thanks in advance
Hi,
Create a dropdownby key element in your view, and bind the selectedKey property to whichever node attribute you wish to bind. When you select a value in the dropdown, it is this value you have to bind.
The code will be like:
data: lr_node type ref to if_wd_context_node,
lt_valueset type table of wdr_context_attr_value,
ls_valueset type wdr_context_attr_value,
lr_nodeinfo type ref to if_wd_context_node_info.
lr_node = wd_context->get_child_node('NODE').
lr_nodeinfo = lr_node->get_node_info( ).
ls_valueset-value = 1.
ls_valueset-text = 'Value 1'.
append ls_valueset to lt_valueset.
cleaR: ls_valueset.
ls_valueset-value = 2.
ls_valueset-text = 'Value 2'.
append ls_valueset to lt_valueset.
lr_nodeinfo->set_attribute_value_set(
exporting
name = 'ATTRIBUTE_NAME'
valueset = lt_valueset
).
Do this in the wddoinit method of your view so that the values will be populated initially. Define an action for the onSelect event of the drop down. In the event handler, if you do a get_element on the node, the value selected will be returned. The 'value' in the value set is what will be selected. The text is what you will see displayed in the UI.
This sample code is for drop down by key. You can have a drop down by index also. Refer to the component WDR_TEST_EVENTS for both types of drop downs.
Hope this helps. Reward points for useful answers.
Regards,
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ANzy.
I have restructed the WIKI section a bit some time ago. Maybe we should put it in the UI Elements section of the FAQ. When I find some time I will do an update of the context section with the attribute value set thing.
In general it would be cool if we would put some more effort in the WIKI section.
Maybe we can brainwash people into searching the WIKI and the forum by posting links to solutions to their questions and not answering each question over and over. But for this we need more content in the WIKI.
Cheers,
Sascha
Hi,
If your issue is solved, can you please award points and close the thread.
Regards
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.