k-billy
08-08-2003, 11:30 AM
Hi Antun,
first, thanks for your help yesterday with regards the pagination problem. Using the datapath as a child node and setting the 'pooling' attribute to true definitely improved the performance of my component.
However, I am encountering a new problem with the datapath node. I am putting a javascript expression into the datapath's 'xpath' attribute. It looks like this:
-----code-----
<view name='datarow'>
<datapath xpath="${classroot.getAttribute('replicationPath')}" replication='normal' pooling="true"/>
<method event="ondata">
//reset the key each time data is reloaded
var keyfname = classroot.getColumnDataPointer("columns/").getXPath('@keyfname');
this.setAttribute('key', this.datapath.getXPath(keyfname));
if(classroot.getAttribute('initialized') == 'false'){
var lz = classroot.getColumnDataPointer("columns/column[1]");
do{
var lztxt = new LzText(this, null);
var fname= lz.getXPath('@fname');
var initWidth = lz.getXPath('@initwidth');
lztxt.setAttribute('datapath', fname);
lztxt.setAttribute('name', 'displaytxt');
lztxt.setAttribute('width', initWidth);
}while(lz.selectNext());
}
</method>
</view>
----end of code-------
When I hard-code the xpath attribute, the datapath gets created at the correct time and the datarow's children views are able to access the necessary data.
However, when I use the Javascript expression (I have confirmed that it is correct) thehe datapath node is getting initialized 'after' the parent node's 'ondata' method is called. The result of this is that the datarow's child views don't have any content (i.e. because the datapath object hasn't been created yet).
Is there any way to control the order in which nodes get created, or do you see any flaw in the code?
Regards,
Caleb
first, thanks for your help yesterday with regards the pagination problem. Using the datapath as a child node and setting the 'pooling' attribute to true definitely improved the performance of my component.
However, I am encountering a new problem with the datapath node. I am putting a javascript expression into the datapath's 'xpath' attribute. It looks like this:
-----code-----
<view name='datarow'>
<datapath xpath="${classroot.getAttribute('replicationPath')}" replication='normal' pooling="true"/>
<method event="ondata">
//reset the key each time data is reloaded
var keyfname = classroot.getColumnDataPointer("columns/").getXPath('@keyfname');
this.setAttribute('key', this.datapath.getXPath(keyfname));
if(classroot.getAttribute('initialized') == 'false'){
var lz = classroot.getColumnDataPointer("columns/column[1]");
do{
var lztxt = new LzText(this, null);
var fname= lz.getXPath('@fname');
var initWidth = lz.getXPath('@initwidth');
lztxt.setAttribute('datapath', fname);
lztxt.setAttribute('name', 'displaytxt');
lztxt.setAttribute('width', initWidth);
}while(lz.selectNext());
}
</method>
</view>
----end of code-------
When I hard-code the xpath attribute, the datapath gets created at the correct time and the datarow's children views are able to access the necessary data.
However, when I use the Javascript expression (I have confirmed that it is correct) thehe datapath node is getting initialized 'after' the parent node's 'ondata' method is called. The result of this is that the datarow's child views don't have any content (i.e. because the datapath object hasn't been created yet).
Is there any way to control the order in which nodes get created, or do you see any flaw in the code?
Regards,
Caleb