on 04-07-2009 6:19 PM
Hi Experts,
Could some one plz tell me how we can create a dropdown by key or a dropdown by index in a table
with completely different set of values in each row of the table, i am aware of haow to create dropdown cell editors in a table but i am stuck with passing different values at each row level.
Your Responses would be acknowledged,
Chaitanya.
Hi,
You can use drop down by Index and take a variable of type the valueset and fill the valuesets
different for each row. Bind this valueset by getting the column references of the table.
Create a attribute in the node as VALUESET of type WDR_CONTEXT_ATTR_VALUE_LIST to which the table is bound.
Now fill the valueset -
DATA:
ls_value_set TYPE wdr_context_attr_value.
loop at lt_final into ls_final.
***For each row based on condition fill the valueset.
ls_value_set-text = space.
INSERT ls_value_set INTO TABLE ls_final-valueset.
ls_value_set-value = space.
ls_value_set-text = '1'.
INSERT ls_value_set INTO TABLE ls_final-valueset.
append ls_final to lt_final1.
clear ls_final.
endloop.
lt_final1 bind to the table.
Now get the column references of the node to which table is bound.
DATA: lr_node type ref to if_wd_context_node,
lr_info type ref to if_wd_context_node_info.
lr_node = wd_context->get_child_node( 'FINAL' ).
lr_info = lr_node->get_node_info( ).
Use GET_COLUMNS of cl_wd_table to get column references.
declare a dropdown index element.
loop at the lt_columns into lr_cols.
when 'colname'.
CREATE OBJECT lr_drp_idx
EXPORTING
selected_key_fieldname = lv_id. "column name
lr_drp_idx->set_texts( 'VALUESET' ). "Attribute name of the node
or set_on_select to bind the valuset attribute
lr_cols->set_cell_editor( lr_drp_idx ).
endloop.
Like this you can fill different valuesets for each row.
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Dropdown By Key is not of use in this case, Dropdown by Index is very much helpful for this kind of information.
just go through the UI element in WDR_TEST_EVENTS component
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to use a DropDownByIndex in that case. You can use the simpler DropDownByKey when you need the same values on each dropdown regardless of the table row.
For populating a DropDownByIndex subnode, you can use a supply function.
Here you have more details (you can also search this forum): http://help.sap.com/saphelp_erp2005/helpdata/EN/dd/b0884118aa1709e10000000a155106/content.htm
Quoting:
If you want to create a table with dropdown lists, whereby each table row can have different values in its dropdown list, you should use DropDownByIndex.
...
You can find examples of this interface element in the system in the Web Dynpro application WDR_TEST_UI_ELEMENTS, and in the component WDR_TEST_EVENTS in the view DropDownByIdx.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chaitanya,
I have a suggestion which can be helpful ( not sure though ).
You can repopulate the dropdowns on the OnLeadSelect event of the table.
This will let you present different dropdown values as per the row selected.
I hope it helps.
Please revert back in case of issues.
Regards,
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.