Reading Child value in tree( On action)
I have created a tree taking WDR_TEST_EVENTS( component)-->TREE_RECUR_DYNLOAD( view) as reference.
I want to read now the value of leaf ( child element ) when user select it( onAction event). I have written some code but it's not working.
In onaction event method I have written below code.
DATA: lv_nd_node1 TYPE REF TO if_wd_context_node,
lv_el_node1 TYPE REF TO if_wd_context_element,
lv_text TYPE wd_this->element_node1-text.
lv_nd_node1 = wd_context->path_get_node
( path = `TREE1_ROOT.NODE1` ).
lv_el_node1 = lv_nd_node1->get_element( ).----
( this is coming as initial )
name = `TEXT`
value = lv_text ).
lv_el_node1 is coming as initial when I select file( leaf) but it's populated when i select folder.
Can any one help in finding error or guiding me to correct solution.
Can you insert a importing parameter context_element to the action handler method and see if it is filled automatically ?