on 12-12-2008 1:18 PM
Hi All,
I'm using Tree UI Element in which Collapse All button is coming defaultly in that Tree Application . But i need to know how the function is taking place behind . Because i need to refer to do it for Expand All scenario for the same tree . Is that collapse is refering to any method in class ? . Can anyone brief out the coding of that . Or if anyone knows the coding of Expand all pls refer to me,
Hello Ramesh Vinay,
*Create a node which has attributes (EXPANDED, IS_LEAF,ROW_KEY and PARENT_ROW_KEY) to build a tree.
Following code will be executed when COLLAPSE ALL button is clicked.
DATA: lo_nd_tree TYPE REF TO if_wd_context_node,
lt_elements TYPE wdr_context_element_set.
FIELD-SYMBOLS:
<lo_element> TYPE REF TO if_wd_context_element.
lo_nd_tree = wd_context->get_child_node( name = wd_this->wdctx_tree).
lt_elements = lo_nd_tree ->get_elements( ).
LOOP AT lt_elements ASSIGNING <lo_element>.
<lo_element>->set_attribute(
EXPORTING value = abap_false
name = u2018EXAPNDEDu2019 ).
ENDLOOP.
Following code will be executed when EXPAND ALL button is clicked.
DATA: lo_nd_tree TYPE REF TO if_wd_context_node,
lt_elements TYPE wdr_context_element_set.
FIELD-SYMBOLS:
<lo_element> TYPE REF TO if_wd_context_element.
lo_nd_tree = wd_context->get_child_node( name = wd_this->wdctx_tree).
lt_elements = lo_nd_tree ->get_elements( ).
LOOP AT lt_elements ASSIGNING <lo_element>.
<lo_element>->set_attribute(
EXPORTING value = abap_true
name = u2018EXAPNDEDu2019 ).
ENDLOOP.
Reply me if you have any questions.
Thanks,
Bharath.K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bharath ,
Thanx for ur helpful reply.
Collapse all functionality is working fine . But in expand all , initially it expands only the first folder , after then it expands only to the point where i have last left behind with my manual extension to that point.
Suggest sny solutions where i have done wrong.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.