on 08-09-2007 8:25 AM
Hi Experts,
Is it possible to display data from multiple models in one table smltnsly.
I have created a table dynamically.Now I would like to display data from multiple models... If this possible,can anyone give me a lead as to how to do it..
Regards
SU
Hi
You can bind only one Node to a Table control.
So you create a value node and add attributes you want to display.
Loop through all the Model nodes and add it to the value node.
Regards
Abhimanyu L
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Your Model Nodes be
Model1
---Output_Model1
-
Attrib1
-
Attrib2
Model2
---Output_model2
-
Attrib1
-
Attrib2
and the value node is
ValueNode
---Attrib1
---Attrib2
Now the coding.
int size;
IPrivate<ViewName>.IOutput_mode1Node node1 = wdContext.nodeOuptut_Model1();
IPrivate<ViewName>.IValueNodeElement elem;
size = node1.size();
for(int i=0; i<size; i++)
{
elem = wdContext.createValueNodeElement();
elem.setAttrib1( node1.getOutput_Model1ElementAt(i).getAttrib1() );
elem.setAttrib2( node1.getOutput_Model1ElementAt(i).getAttrib2();
wdContext.nodeValueNode().addElement( elem );
}
similar code for Model Node 2
Regards
Abhimanyu L
Hi SU,
I think the code ,what abhimanyu has sent is sufficient.U can follow these steps:
1. Create a value node with all the attributes u want in ur table.
2. In the layout,create a table using apply template & give the value node as data source.
3. Use the code what abhimanyu has sent for copying the data from model node to value node.
That's all
regards
Sumit
Thanks for the reply..
One more question...
In my scenario, there are chances that same data will be present in the multiple models... How do we check th same in WD.?
Regards
SU
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.