on 09-05-2007 6:20 PM
hi,
I want use the dropdownbykey in table. when the value changed, i will get the
element of the context, and update the other field value.
how can i get the element in the action method of the dropdownbykey UI element
?
Thank you for your help!
Hi!
... if i understand you right for example by getting the lead selection of your table and then accessing the field.
structure_of_your_table type TYPE IF_yourview=>ELEMENT_ýournodename_of_the_table,
LO_NODE type ref to IF_WD_CONTEXT_NODE,
LO_LEAD_ELEMENT type ref to IF_WD_CONTEXT_ELEMENT,
obtain current lead selection
LO_NODE = WD_CONTEXT->GET_CHILD_NODE( IF_yourview=>WDCTX_yournodename_of_the_table ).
LO_LEAD_ELEMENT = LO_NODE->GET_LEAD_SELECTION( ).
if LO_LEAD_ELEMENT is bound.
LO_LEAD_ELEMENT->GET_STATIC_ATTRIBUTES( importing STATIC_ATTRIBUTES = structure_of_your_table).
endif.
CASE structure_of_your_table-your_dropdownfield.
WHEN .....
ENDCASE.
Regards,
Volker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is my source code in ON_SELECT action of DropDownbykey
data:
text type string,
element type ref to if_wd_context_element,
node_it_result_data TYPE REF TO IF_WD_CONTEXT_NODE,
key type string.
key = wdevent->get_string( 'KEY' ).
node_it_result_data = wd_context->get_child_node( 'IT_RESULT_DATA' ).
element = node_it_result_data->get_lead_selection( ).
element->set_attribute( name = 'TIME_AREA' value = key ).
Hi,
In your code, do not use the method get_lead_selection. This will return you only the lead selection, which will mostly be different from the row which you have selected for the drop down.Use the following command instead:
element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
Then do a get_static_attributes to get the data and subsequently, do element->set_attribute( ) to set the values. Use the get_context_element exactly as I have given, do not change the parameter.
Regards
Nithya
You can read the context which is bound to your dropdown key element.
Here Land1 is the drop down element. At the runtime i am reading this value and updating other field.
Node_Vend_Add1 = wd_Context->get_Child_Node( Name = wd_This->wdctx_Vend_Add1 ).
get element via lead selection
Elem_Vend_Add1 = Node_Vend_Add1->get_Element( ).
get single attribute
Elem_Vend_Add1->get_Attribute(
exporting
Name = `LAND1`
importing
Value = Item_Land1 ).
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.