cancel
Showing results for 
Search instead for 
Did you mean: 

Expand tree in WebDynpro ABAP application

Former Member
0 Kudos

Hi,

Currently I am working on a WDA application which contains a UI ELEMENT TREE. The tree is generated dynamically at runtime.

I was guided by the example of SAP "WDT_TREE". After generating the tree looks like this:

TREE
   | __ NODE1
           | __ LEAF1
           | __ LEAF2
           | __ NODE2
                | __ LEAF3
           | __ Node3
                | __ LEAF4
                | __ LEAF5
                | __ LEAF6

Now I have bound the "expanded" property of the node to a context element and execute the following action in the WDDOINIT:


* Fill tables with the structure of the tree
  fill_foldertable( ).
  fill_filetable( ).

  lr_current_node    = wd_context->get_child_node( 'FOLDER' ).
  lr_current_element = lr_current_node->create_element( ).
  lr_current_node->bind_element( lr_current_element ).
  lr_current_node->set_lead_selection( lr_current_element ).

  lr_current_element->set_attribute( name = 'TEXT' value = 'Products' ).
 lr_current_element->set_attribute( name = 'IS_EXPANDED' value = 'X' ).

* Create the root node
  create_node(
    EXPORTING
      cur_element = lr_current_element
      parent_key  = 'Categories' ).

Now the tree is expanded, but i can't see EAF1 and LEAF2. I get them only by clicking again on node1.

Any ideas?

Regards.

Accepted Solutions (1)

Accepted Solutions (1)

Sharathmg
Active Contributor
0 Kudos
lr_current_node    = wd_context->get_child_node( 'FOLDER' ).
  lr_current_element = lr_current_node->create_element( ).

lr_current_element->set_attribute( name = 'IS_EXPANDED' value = 'X' ).

You have set the expnaded property for the parent node.

Ensure that you repeat the code even for child nodes. This should expand the child nodes of the tree.

Regards,

Sharath

Former Member
0 Kudos

Thanks for your reply!

I tried your solution but my problem still exists.

The tree is expanded but LEAF1 and LEAF2 are not showed.

I build the tree in my application exactly like in application WDT_TREE.

How would you implement the "EXPANDED" functionality in this application?

Thaks a lot.

Former Member
0 Kudos

Hello Juergen,

You need to maintain the Parent ID of the child nodes Leaf 1 and Leaf2 and expanded propert at child node level.

if this doesnt help, Kindly share your code by which you generate the data for the context.

Regards

Anurag Chopra

Former Member
0 Kudos

Anurag Chopra,

thanks a lot for your answer. This was exactly my problem!

Regards.

Former Member
0 Kudos

Hi Anurag,

My requirement is to expnad the whole tree once the application is started. I am setting EXPAND property of Parent node as 'X'. Even then once the application is started i can t see the expanded tree.

Please help me how to expand whole tree once the application is started.

Thanks in Advance.

Pavan Maddali

Edited by: maddalipavan on Jan 25, 2011 1:22 AM

Former Member
0 Kudos

Hi All,

I found the solution for my question. Expand tree in Webdynpro application

Soultion

In the context node i.e used as a source for tree, you create a attribute

Attribute Name: IS_BOOLEAN

Attribute type : WDY_BOOLEAN

Default Value : X

And in Context node Un check the Initialization lead selection.

Now bind the Expand property of TreeNodeType with 'IS_EXPAND' which you have created just now.

This way the whole tree will be expanded.

Regards,

Pavan Maddali

Former Member
0 Kudos

Hi Pavan,

I am using WD UI element TreeByKeyTableColumn for showing the Workflow details in my WD Conponent and having thes ame problem.

I tried the solution which you suggested by dis'nt work for me .

Can you please help me in the same.

Regards,

vishal chauhan

thomas_gaberthel
Explorer
0 Kudos

Dear Vishal,

have you already found a solution for your issue? I'm also using thies UI element and like to expand the hierarchy .

Best Regards,

Thomas Gaberthüel

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

For your requirement please check the standard webdynpro component WDR_TEST_EVENTS

check the application you can find at the left side the tree, check which is suitable for your requirement.

See the related logic will hlep you.

Regards,

Naresh Kumar.