on 06-18-2007 1:20 PM
Hi,
I've created a DropDown by index in my Webdynpro, but I don't know how can I populate it. Can your help me?
Thanks.
Hi Moreno,
Consider a simple scenario where you want to display yes and no in your drop down.
Bind the 'TEXTS' property of your drop down with a node attribute.You can give the cardinality of the node as 0..n and selection as 0..1.For this example consider the node name is 'dropdown'.
DATA lo_nd_dropdown TYPE REF TO if_wd_context_node.
data: Stru_dropdown type If_Main=>Elements_dispose,
wa_stru_dropdown TYPE wd_this->element_dispose.
navigate from <CONTEXT> to <DISPOSE> via lead selection
lo_nd_dropdown = wd_context->get_child_node( name = wd_this->wdctx_dropdown ).
wa_stru_dropdown-DEACTIVATE_VAL = 'Yes'.
INSERT wa_stru_dropdown INTO TABLE Stru_dropdown.
wa_stru_dropdown-DEACTIVATE_VAL = 'No'.
INSERT wa_stru_dropdown INTO TABLE Stru_dropdown.
lo_nd_dropdown->bind_elements( Stru_dropdown ).
this should fill up your pop up by values 'yes' and 'no'.
Basically you are just binding a table containing the desired values with the node.
Hope this solves your problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok.
Lets take SCARR and display all available carriers.
Create a node carriers and assign structure SCARR with all fields to the node.
Set cardinality 0..n and init lead selection.
then enter supply_carriers as supply method at the bottom. double click the method name and use the following code in the method:
data:
lt_carriers type table of scarr.
select * from scarr
into corresponding fields of table lt_carriers.
node->bind_table( lt_carriers ).
node is the reference of the context node you want to supply and is transfered by the system.
The go to your drop down and bind the textx attribute to the carrname field of the context node carriers.
Thats it.
Cheers,
Sascha
Check the webdynpro component WDR_TEST_EVENTS, which is an example to use various UI elements. There is a view for drop down by index also, that will be of help to you.
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.
create a context node of some structure which contains the elements for the dropdown. One attribute of this structure shoul contain the text you want to display in the drop down. Then bind the texts property of the dropdown to this attribute.
for example:
node (cardinality 0..n or 1..n)
--- attribute customer name
--- attribute customer number
bind attribute customer name to the texts attribute of dropdown by index and all names will be displayed. Fill this node in supply method for example.
Afterwards you can get the selected element via the lead selection.
If you set initialize lead selection the first element of the node will be preselected in the drop down.
Voila.
Cheers,
Sascha
Message was edited by:
Sascha Dingeldey
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.