on 10-14-2009 8:12 AM
Hello community,
i have a question about the Tree UI element.
What do i have to do if i want to expand the tree nodes to see my seleted item?
If i set the lead selection, i can see the parents marked, but i cant get them expanded.
Is there a way to expand a single tree node?
Please dont answer "Click at the arrow in front of it".
A hint or a line of code would be very useful, thank you
Nobody knows how do expand/open a specific treenode?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does your tree structure has some attribute of type boolean
if not then create an attribute ex. is_expanded of type wdy_boolean and then while forming the tree you can set this attribute property to abap_true for folder.
You can then bind this attribute is_expanded to expanded property of your master column.
Hope this helps you.
example code - here based on some selection i'm marking my tree node as expanded
*for entity, read from dt_entries, if found then expand this folder
READ TABLE dt_entries INTO ls_entry WITH KEY name = ls_ent_att-usmd_entity parent_name = ls_ent_att-parent_entity.
IF sy-subrc = 0.
ls_entry-intfmodelcheck = abap_true.
ls_entry-is_expanded = abap_true.
MODIFY dt_entries FROM ls_entry INDEX sy-tabix TRANSPORTING intfmodelcheck is_expanded .
ENDIF.
Regards
manas dua
Thank you very much.
I just wondered why the Expanded propertie just didnt work if I set it to true in the layout creation.
But now it works perfectly
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
thanks for the fast answer.
The problem is not setting up the tree.
I already got the tree with all entries i need, recursive child node etc.
My program does search inside the tree for a specific node and if it finds one , it sets the node's lead selection.
But the Tree keeps beeing compressed but i need it to show the element not just the 1. Level parent
Edited by: Dominik Keil on Oct 14, 2009 9:22 AM
I already got my table similar to wdt_tree example but imagine if you want to create a new "file" in to the table and refresh it. After that refresh you want to see the selected entry inside the tree.
here is my example:
CONTEXT and TREE
ROOT
--->Folder A
--->Folder B
-
>FileA
You create a new file.
then you context has the following Structure:
CONTEXT
ROOT
--->Folder A
--->Folder B
-
>FileA
-
>_FileB_
but the tree is displayed like following.
TREE
ROOT
--->Folder A
---> Folder B
-
>FileA
and you want you programm to refresh the tree, maybe someone else inserted a new file too and after that u want your new file beeing selected.
I do refresh my tree and set the lead selection to my new file and all i see is:
(Selecion is marked with underline)
Tree
ROOT
--->Folder A
--->_Folder B_
But the lead_selection is:
Context
ROOT
--->Folder A
--->_Folder B_
-
>FileA
-
>_FileB_
and i want to get the Node Folder B expanded via code. I hope you could follow my confusing explaination
Edited by: Dominik Keil on Oct 14, 2009 10:55 AM
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.