cancel
Showing results for 
Search instead for 
Did you mean: 

write the data in 'tree' UI element

Former Member
0 Kudos

Hi Expert,

I am trying to create a simple application in that i am using the 'tree' UI element . I want to write the some data in that tree element how can i do this

I want a code please its urgency

Thanks & Regards

Vijay Yewale

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

hi

thanks for the quick reply

can you tell me the code of

create a tree and to store the value in that in this format

Project1

Component1

Object1

Object2

Object3

Component2

Component3

Project2

Project3

thanks & Regards

vijay

Edited by: Vijay Yewale on Jun 4, 2008 3:45 PM

Former Member
0 Kudos

Context:


Projects (node, 0:n)
-- name (string)
-- Components (node, 0:n, singleton=false)
---- name (string)
---- Objects (node, 0:n, singleton=false)
------ name (string)

UI element structure:

- Add Tree element with ID "Tree" into view.

- Add TreeNodeType elements with IDs "TreeNodeTypeProject", "TreeNodeTypeComponent" to tree.

- Add TreeItemType element with ID "TreeItemTypeObject" to tree.

UI element data binding:


Tree.dataSource = Projects
TreeNodeTypeProject.dataSource = Projects
TreeNodeTypeComponent.dataSource = Projects.Components
TreeItemTypeObject.dataSource = Projects.Components.Objects

Bind "text" properties to corresponding context attributes ("name")

Code to create context data:


IProjectsElement p1 = wdContext.nodeProjects().createAndAddProjectsElement();
p1.setName("Project1");
IComponentsElement c1 = p1.nodeComponents().createAndAddComponentsElement();
c1.setName("Component1");
for (int i = 0; i < 3; i++)
{
  IObjectsElement o = c1.nodeObjects().createAndAddObjectsElement();
  o.setName("Object" + i);
}
/* etc */

In older releases use createXYZElement() and addElement() instead of createAndAddXYZElement().

Armin

Added more details

Former Member
0 Kudos

thanks for the quick reply

i write this code in init() method and i create the context

but it not showing the "TreeNodeTypeProject" property it just showing the "TreeNodeType property"

and it slow not showing the "createandAddprojectElement()" property

what can i do

please Reply

thanks & Regards

vijay

Former Member
0 Kudos

I thought the given information would have been sufficient to understand what to do, but they obviously were not. Therefore I added more details.

Armin

Former Member
0 Kudos

hai Vijay,

This link shows a video presentation of tree UI element and recursive nodes creation

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70b584d5-9401-2b10-f88a-a98252d5...

This link gives step by step procedure and codings

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/de59f7c2-0401-0010-f08d-8659cef5...

Any Issue plz do let me know.

Thanks n Regards

Sharanya.R