Populating multiple grids from the same XML message?
I may have posted a similar question before, but can't find it, or any unrelated posts which answer it.
I wish to receive a single XML message and display the data in two separate grids. I had wondered if a many-to-one Grid-Table was relationship possible. However, the fact that setRows is a method of AW.XML.Table suggests that a single Table instance can't solve this problem. If Grids set their own internal 'rows' property when the setCellModel is called then some trickery might make it possible? How does it work Alex?
Another alternative I considered is doing something like:
var table1 = new AW.XML.Table();
table1.setRows("//xpath/appropriate/for/grid1");
table1.response = function(xml) {
...
var rootNodeForTable2 = this.getXML().getElementById("idOfRelevantNode");
table2.setXML(rootNodeForTable2 );
...
}
var grid1 = new AW.UI.Grid();
grid1.setCellModel(table1);
var table2 = new AW.XML.Table();
table2.setRows("//xpath/appropriate/for/grid2");
var grid2 = new AW.UI.Grid();
grid2.setCellModel(table1);
I haven't tried this yet and will give it a shot, but perhaps someone else has some other ideas?
Cheers,
Callum.
I wish to receive a single XML message and display the data in two separate grids. I had wondered if a many-to-one Grid-Table was relationship possible. However, the fact that setRows is a method of AW.XML.Table suggests that a single Table instance can't solve this problem. If Grids set their own internal 'rows' property when the setCellModel is called then some trickery might make it possible? How does it work Alex?
Another alternative I considered is doing something like:
var table1 = new AW.XML.Table();
table1.setRows("//xpath/appropriate/for/grid1");
table1.response = function(xml) {
...
var rootNodeForTable2 = this.getXML().getElementById("idOfRelevantNode");
table2.setXML(rootNodeForTable2 );
...
}
var grid1 = new AW.UI.Grid();
grid1.setCellModel(table1);
var table2 = new AW.XML.Table();
table2.setRows("//xpath/appropriate/for/grid2");
var grid2 = new AW.UI.Grid();
grid2.setCellModel(table1);
I haven't tried this yet and will give it a shot, but perhaps someone else has some other ideas?
Cheers,
Callum.
Cal
July 6,