on 07-07-2011 5:34 PM
Hi everyone,
I've got a Tree control in WebDynpro ABAP and I've implemented an "expand all" button.
Here's the coding:
METHOD expand_node_rec.
DATA lo_el_child TYPE REF TO if_wd_context_element.
DATA lo_node_children TYPE wdr_context_child_map.
DATA wa_lo_node_children LIKE LINE OF lo_node_children.
DATA lo_nd_child TYPE REF TO if_wd_context_node.
DATA lo_kschl TYPE klschl.
DATA lv_has_children TYPE boolean.
lo_el_child = node->get_element( ).
lo_node_children = node->get_child_nodes( ).
node->get_attribute( EXPORTING name = 'KSCHL' IMPORTING value = lo_kschl ).
node->get_attribute( EXPORTING name = 'HAS_CHILDREN' IMPORTING value = lv_has_children ).
IF lv_has_children = abap_true.
node->set_attribute( name = 'IS_EXPANDED' value = abap_true ).
ENDIF.
LOOP AT lo_node_children INTO wa_lo_node_children.
lo_nd_child = wa_lo_node_children-node.
me->expand_node_rec( node = lo_nd_child ).
ENDLOOP.
ENDMETHOD.
However I'm getting the error above: "Lead selection not set for context node".
Any suggestions?
Edited by: DEVELOPMENT THEMIS on Jul 7, 2011 6:34 PM
Hi...
lo_el_child = node->get_element( ). will return leadselection element. If you didn't check "initialize lead selection property" for child node, then you may get the error. So check once whether did you check the initialize lead selction property.
Regards
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi developement Themis,
I think u didn't diclare "node" as context node. So declare it as a context node before using as a context node..as below
DATA node TYPE REF TO if_wd_context_node.
or u can use "lo_nd_child " as ur context node in ur program in place of "node"
then I think this error will be removed.
thanks,
simadri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I assume you are getting the error on "lo_el_child = node->get_element( )."?
Have you set the context node to initialize lead selection?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.