jeemeekay
06-19-2007, 05:05 PM
As most developers here are aware, there seems to be a problem with IE processing multiple calls to LzBrowser.loadJS at the same time. See this earlier thread
http://forum.openlaszlo.org/showthread.php?t=5523&highlight=loadjs+serializer
I don't know if this is much useful to anyone but i modified the code from the earlier thread to produce a serializer class that acts as a queue of commands,
<class name="commandSerializer" extends="list" >
<attribute name="processing" type="boolean" value="false" />
<method name="doCommand" args="a">
this.addItem(a,a);
if (!this.processing) {
this.doNextDelegate = new LzDelegate(this,"doNextCommand");
this.processing = true;
LzTimer.addTimer(this.doNextDelegate,50);
}
</method>
<method name="doNextCommand">
<![CDATA[
var cmd = this.getItemAt(0).getValue();
if (cmd != null && cmd.length > 0) LzBrowser.loadJS(cmd);
this.removeItemAt(0);
if (this.getNumItems() > 0) {
LzTimer.resetTimer(this.doNextDelegate, 50);
}
else {
this.processing = false;
}
]]>
</method>
</class>
I hope someone finds this useful as i did.
Cheers.
http://forum.openlaszlo.org/showthread.php?t=5523&highlight=loadjs+serializer
I don't know if this is much useful to anyone but i modified the code from the earlier thread to produce a serializer class that acts as a queue of commands,
<class name="commandSerializer" extends="list" >
<attribute name="processing" type="boolean" value="false" />
<method name="doCommand" args="a">
this.addItem(a,a);
if (!this.processing) {
this.doNextDelegate = new LzDelegate(this,"doNextCommand");
this.processing = true;
LzTimer.addTimer(this.doNextDelegate,50);
}
</method>
<method name="doNextCommand">
<![CDATA[
var cmd = this.getItemAt(0).getValue();
if (cmd != null && cmd.length > 0) LzBrowser.loadJS(cmd);
this.removeItemAt(0);
if (this.getNumItems() > 0) {
LzTimer.resetTimer(this.doNextDelegate, 50);
}
else {
this.processing = false;
}
]]>
</method>
</class>
I hope someone finds this useful as i did.
Cheers.