on 03-31-2008 9:14 AM
hi,
i have two questions:
1. i have a drop down list as one of the columns in my table. i have context node having an attribute. how do i fill this drop down list.
2. once this drop down list is filled, i want to pass the value to a method when i select a value from the drop down list.
waiting for reply.
Thanks & Regards,
Ritwik.
Hi Ritwik,
Use method set_attribute_value_set of is used to set dropdown values to an attribute of a node.
DATA: lx_current_controller TYPE REF TO if_wd_controller,
lx_node_info TYPE REF TO if_wd_context_node_info,
lx_element TYPE REF TO if_wd_context_element,
ls_value TYPE wdy_key_value,
lt_value_set TYPE wdy_key_value_table,
lx_current_controller = wd_this->wd_get_api( ).
Get the Values to that need to be set as dropdown,
Build the values set internal table. by doing the below.
CLEAR ls_value.
ls_value-key = ls_t005t-ID.
ls_value-value = ls_t005t-Airine.
APPEND ls_value TO lt_value_set[].
Set the dropdown.
Get Context reference
lx_node_info = wd_context->get_node_info( ).
Get Node 'INPUT_NODE' Reference
lx_node_info = lx_node_node->get_child_node( name = 'INPUT_NODE' ).
Set the Drop down.
lx_node_info->set_attribute_value_set( name = 'CARRID' value_set = lt_value_set ).
This would build the dropdown for the attribute.
Bind this to the column that must be displayed as DD.
Set the column type as 'Drop Down'
Hope this helps.
Regards,
Sravan Varagani
Edited by: Sravan Varagani on Mar 31, 2008 2:32 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi alex,
i wrote the following code:
DATA lo_nd_test TYPE REF TO if_wd_context_node.
DATA lo_el_test TYPE REF TO if_wd_context_element.
DATA ls_test TYPE wd_this->element_test.
DATA lt TYPE TABLE OF spfli.
navigate from <CONTEXT> to <TEST> via lead selection
lo_nd_test = wd_context->get_child_node( name = wd_this->wdctx_test ).
get element via lead selection
lo_el_test = lo_nd_test->get_element( ).
SELECT * FROM spfli into CORRESPONDING FIELDS OF TABLE lt.
CALL METHOD LO_ND_TEST->BIND_TABLE
EXPORTING
NEW_ITEMS = lt
SET_INITIAL_ELEMENTS = ABAP_TRUE
INDEX =
.
it gave me the error ASSERT CONDITION VIOLATED.
regards,
Ritwik.
hi alex,
i created two nodes:
TEST for the table and
DD for the drop down list.
i binded the drop down with DD.
and i wrote the following code in my WDDOINIT.
nthing is getting displayed in the Drop Down List.
DATA lo_nd_dd TYPE REF TO if_wd_context_node.
DATA lo_el_dd TYPE REF TO if_wd_context_element.
DATA ls_dd TYPE wd_this->element_dd.
DATA lt TYPE TABLE OF spfli.
navigate from <CONTEXT> to <DD> via lead selection
lo_nd_dd = wd_context->get_child_node( name = wd_this->wdctx_dd ).
get element via lead selection
lo_el_dd = lo_nd_dd->get_element( ).
SELECT carrid from spfli into CORRESPONDING FIELDS OF TABLE lt.
CALL METHOD LO_ND_DD->BIND_TABLE
EXPORTING
NEW_ITEMS = lt
SET_INITIAL_ELEMENTS = ABAP_TRUE
INDEX =
.
regards,
Ritwik.
hi ritwik......
a node of cardinlity 0..n must be assigned to the drop down. fill the drop down with values just as you would do for a table.
drop down as an action called on select. make use of that.
--regards,
alex b justin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ritwik....
this is how you should create:
node for table:
col1
col2
cardinality 0..n.
bind this node to the table.
node for drop down:
col1
cardinality 0..n.
right click table uielement.
insert table column.
rightclick table column.
insert cell editor.
make it as drop down.
bind the drop down node to it.
write seperate codings for both the nodes.
---regards,
alex b justin
User | Count |
---|---|
78 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.