cancel
Showing results for 
Search instead for 
Did you mean: 

How to show data in table on the basis of click on a row of another table

Former Member
0 Kudos

Hi All,

I want to show two tables. In first table the main objects show in turn there is another collection in that main object for which i want to show data in separate table.

e.g.,

ObjectA

have the collection of ObjectBs

when i select ObjectA in main table then all the collection Objects of ObjectBs shows in separate table. Plz help me how to handle this case ??

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

thks to all

monalisa_biswal
Contributor
0 Kudos

hi,

You can create two value nodes for storing these collections. The first one would be singleton node as it is the main list. Under that create the second node with singleton = false.

e.g.

---NodeA

--attrA1

--attrA2

--NodeB(singleton = false)

--attrB1

--attrB2

Now populate collection of object A in NodeA and after adding element in NodeA populate respective elements in NodeB.

IPrivate<View>View.INodeANode nodeA = wdContext.NodeAnode();

for (Iterator it = collectionA.iterator(); it.hasNext(); )

{

ObjectA objA= it.next();

IPrivate<View>View.INodeAElement nodeAElem= nodeA.createNodeAElement();

wdCopyservice.copy Corresponding(objA,nodeAElem);

nodeA.addElement(nodeAElem);

Collection collectioB =objA.getCollectionB();

for (Iterator it1 = collectionB.iterator(); it1.hasNext(); )

{

ObjectB objB= it1.next();

IPrivate<View>View.INodeBNode nodeB = nodeAElem.nodeBnode();

IPrivate<View>View.INodeAElement nodeBElem= nodeB.createNodeBElement();

wdCopyservice.copy Corresponding(objB,nodeBElem);

nodeB.addElement(nodeBElem);

}

}

Bind NodeA to the first table and NodeB to second one.

After that when you select record in first table automatically its corresponding records will be populated in second table.

Hope this helps!

Monalisa

Former Member
0 Kudos

Create a context structure like


Master (node, card=0:n)
+ Details (node, card=0:n, singleton=true, supply function=supplyDetails)

Bind the master table to node "Master" and the details table to node "Details". That's it.

Armin