Skip to Content
avatar image
Former Member

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.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Feb 16, 2011 at 01:56 PM

    Can you insert a importing parameter context_element to the action handler method and see if it is filled automatically ?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Baskaran,

      Thanks a lot for help it works perfectly 😊 .

      Kindly answere two of my queries if you have some time.

      1. How you come to know ( any documentation) that this parmeter can be available inside event?

      2. why my logic failed to read the attribute? as this is the way we read attribute value!

      again thanks a lot.