cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Child value in tree( On action)

Former Member
0 Kudos

Hi,

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 )

lo_el_node1->get_attribute(

EXPORTING

name = `TEXT`

IMPORTING

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.

Regards

Anurag

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Answers (0)