cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with tree view

Former Member
0 Kudos

Hello and good morning,

i´ve got a problem with a tree view in one of our web dynpro applications.

The tree view act´s as a menu. For example:

the highest element is: personal

If you open personal you see:

recruiting

payment

and so on...

Our Problem is...

You can open the tree element by clicking on the little box left from the tree-element text.But we want that the tree-element is also "line-sensitieve". This means, the next elements should not only appear by clicking the box, also by clicking simply the line.

Is this possible.

PS: Sorry for this bad application, but i don´t know how to explain it better

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Benjamin ,

I was not able to understand what exactly you need .Still I can help you with problem .

I had similar req. where Root not was org unit and sub node under each org were as Org_Subunit and below it Org_Dept_Unit .

What I did that I carefully analysed some sample Demo applications .Same

I will suggest for you .

<b> WDR_TEST_EVENTS</b>. and in that see Views

TREE_EASY_BINDING

TREE_STATIC

TREE_WITH_TABLE

For Recursive node <b>TREE_REC_MAPPED</b>

not just that see Demo components

<b>WDR_TEST_TREE

WDT_TREE_TABLE_BY_NST</b>

Cheers

Parry

senthil_kumar29
Participant
0 Kudos

Hi Benjamin,

Sam here.

I have checked the component WDT_TREE_TABLE_BY_NST.

The Loading folder method has a parameter PATH.

Is it supplied by frame work. Or How to pass it to the Method.

I would like to keep the tree structure between view navigation. I mean, if the user select some nodes and drill down, I need show the same collopsed structure when the user navigate back to the view.

ThanQ for Ur time.

Cheers,

Sam

Former Member
0 Kudos

Thanks, so far it works...

When i click personal (line) it opens the menu ( this is wanted an his works) but when i click on recruiting for example the whole tree close again.

What is our mistake?

Former Member
0 Kudos

Can you please paste the code that governs this behaviour of opening and closing of nodes .. from the description that you have provided atleast i am not able to figure out any flaw in your approach..

Former Member
0 Kudos
method ONACTIONTOGGLE .
  data:
    Elem_Context                        type ref to If_Wd_Context_Element,
    Stru_Context                        type If_Menu_Tree=>Element_Context ,
    Item_IS_OPEN                        like Stru_Context-IS_OPEN.
data parent_key type string.
    data children_loaded type wdy_boolean.
data x_node type ref to IF_WD_CONTEXT_NODE.

* get context via lead selection
  Elem_Context = wd_Context->get_Element(  ).

* get single attribute
  Elem_Context->get_Attribute(
    exporting
      Name =  `IS_OPEN`
    importing
      Value = Item_Is_Open ).
  if Item_Is_Open = abap_true.
    Item_Is_Open = abap_false.
  else.
    Item_Is_Open = abap_true.
  endif.
  Elem_Context->set_Attribute(
  exporting
    Name =  `IS_OPEN`
    Value = Item_Is_Open ).


endmethod.
Former Member
0 Kudos

I guess every alternate click closes the tree .. am i right ??

Moreover I dont think you are making use of Recursive nodes here .. are you ?? if not then the above mentioned behaviour is goverened by one single instance of attribute .. which is not how it should be ..

I would suggest you go through the test applications on Tree .. it sure will help you out .. look at the node structure and the way they are setting the table properties ..

Former Member
0 Kudos

Hello and sorry for my late answer. Which sample application do you mean exactly ?

Former Member
0 Kudos

Hi Benjamin,

You can check for standard web dynpro application named as

WDR_TEST_EVENTS.

In this there are various examples of tree are given.

Also you can check Package called as SWD_DEMO.

There are few web dynpro components are given.

Hope this will help you.

Cheers,

Darshna.

Former Member
0 Kudos

Hi Benjamin,

Is it that you would like to expand even when you click on "Recruiting", "Payment" etc ?? Well you can use LinkTo Action UI element in master column, your tree, and then the moment user clicks on it you can just expand the same .. all you would need is to bound IS_EXPANDED property of to a context attribute and then set it to true..

You can perform all the operation that you do under OnLoadChildren action ..

Regards,

Anoop