on 05-21-2009 12:08 PM
Hi All
I have the following requirement which i need to display as Tree structure
->Q
->I
->J
->P
->T
->P1
->D
->P2
->P3
->W
->WP
->F
->FT
->I
->In
->P5
->Jo
I created the context structure in the above format and i binded the same thru DataSource property of Tree UI element , but it is not reflcecting the changes in the view as per the above format, it is giving blank structure in the View at runtime
Thanks
Trisha Rani
Edited by: Trisha Rani198 on May 21, 2009 1:08 PM
Hi,
In your posting tree is not properly visible.
"Hierarchies defined in the context can be visualized using the Tree UI element. The hierarchy to be displayed is defined in the context".
As above statement states: You need to have context structure in the same format as you want the tree to look like,
For example, if you need 2 levels in tree--you need to have 2 nodes: A and B, B being sub node of A.
regards,
ganga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ganga
My question is according to the context structure the tree is not displaying for me when i set the context structure in the dataSource property of the Tree UI element,
if we want to display the context structure as we set, do we need to set any specific property to display the tree structure according to the context structure.
Please reply the same
My tree structure as follows
1 .A
2. B
2.1 B1
2.2 B2
2.3 B3
2.4 B4
3 C
3.1 C1
3.2 C2
3.3 C3
3.4 C4
4 D
i want to display the tree structure in the above format and i also create the context struture in the same format but when i set the context strucuture to the dataSource then it is not displaying anything in the Tree of an View.
Please let me know how to achieve this??
Thanks in advance
Thanks
Trisha
Hi,
To create the tree structure in WebDynpro you need to follow the standard procedure.
go through the below links:
/docs/DOC-8061#32 [original link is broken]
In the above examples they filled the dataSource nodes with data from file system.
You can change that code according to your requirement.
1. You need to create a parent context node with necessary attributes like (isExpaned, isLeaf, ChildernLoaded, ParentId..etc)
2. Need to create a recursive child node
3. In the init method fill the parent context node with all the root parents.
4. In OnAction of the root parent item selection fill the child data in child recursive node.
Just go through the above sample code & document.
Regards,
Charan
Hi Trisha
Try to see this document to help you:
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0ec6622-8da5-2a10-349b-868b6a553efa]
[https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/47ce9b90-0201-0010-59b5-f70826824eee]
[https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/de59f7c2-0401-0010-f08d-8659cef543ce]
[http://help.sap.com/saphelp_nw04s/helpdata/en/c2/abfceffbacd24185ec7af8a3a2e76a/frameset.htm]
Regards
Marcos
Context
+ Tree (node, c=0:n)
+ text (string)
+ expanded (boolean)
+ hasChildren (boolean)
+ Children (recursive node -> Tree)
Data binding:
Tree.dataSource = Tree
TreeNodeType.dataSource = Tree
TreeNodeType.expanded = Tree/@expanded
TreeNodeType.hasChildren = Tree/@hasChildren
TreeNodeType.text = Tree/@text
Populate context:
private ITreeElement node(ITreeNode parent, String text, boolean expanded, boolean hasChildren)
{
ITreeElement e = parent.createAndAddTreeElement();
e.setText(text);
e.setExpanded(expanded);
e.setHasChildren(hasChildren);
return e;
}
ITreeElement a = node(wdContext.nodeTree(), "A", false, false);
ITreeElement b = node(wdContext.nodeTree(), "B", true, true);
node(b.nodeChildren(), "B1", false, false);
...
node(b.nodeChildren(), "B4", false, false);
ITreeElement c = node(wdContext.nodeTree(), "C", true, true);
node(c.nodeChildren(), "C1", false, false);
...
node(c.nodeChildren(), "C4", false, false);
ITreeElement d = node(wdContext.nodeTree(), "D", false, false);
Armin
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.