on 08-29-2009 10:35 AM
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 ??
thks to all
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
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.