cancel
Showing results for 
Search instead for 
Did you mean: 

Binding a elelment to a node i a tree

Former Member
0 Kudos

hi experts ,

i am creating a tree (content->treenode->treeleaf ) which display data on the basis of value selected from dropdown list .

initially i display treenode ,for it data is selected in a table in modify method and i binded it to treenode,

now i need whenever i click on any node ,a element sud be displayed under it..

for it i created a action 'ONLOAD_CHILDREN'.

under this action i retrive data i a table and bind this table to TREELEAF ..

but no element is displaying..

please let me know wat i do for binding a element to a node.

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

for TreeNodeType there is a property called expanded,

create a context attribute in the node binded to treenodetype of type boolean and bind it to the expanded property.

in the onLoad_childre, set the attribute value to abap_true

Abhi

Former Member
0 Kudos

hi abhi thanks for ur kind reply..

i did as you said.

but it still not working.

please check code in ONLOADCHILDREN

**it has all data to display

APPEND lwa_treeleaf TO lt_treeleaf.

  • CLEAR lwa_treeleaf.

DATA lo_nd_treeleaf TYPE REF TO if_wd_context_node.

DATA lo_el_treeleaf TYPE REF TO if_wd_context_element.

DATA ls_treeleaf TYPE wd_this->element_treeleaf.

DATA lv_name LIKE ls_treeleaf-name.

lo_nd_content = wd_context->get_child_node( name = wd_this->wdctx_content ).

  • navigate from <CONTENT> to <TREENODE> via lead selection

lo_nd_treenode = lo_nd_content->get_child_node( name = wd_this->wdctx_treenode ).

    • navigate from <TREENODE> to <TREELEAF> via lead selection

lo_nd_treeleaf = context_element->get_child_node( name = wd_this->wdctx_treeleaf ).

*

lo_nd_treeleaf->bind_structure( lwa_treeleaf ).

lo_el_treenode->set_attribute(

  • EXPORTING

name = `EXPANDED`

  • IMPORTING

value = abap_true ).

Former Member
0 Kudos

Hi Swati,

Please check wether there is data there in the node or not to which tree and its items are attached.

I think the items under that tree node has no data. Initially you might have bound some node to the Tree node. Check the table entries that you are binding to the leaf node for that given tree node selected one.

Check the structure to which leaf node has data or not.

Regards,

Lekha.

Answers (0)