[Laszlo-user] Create dataset dynamicly
André Bargull
a.bargull at intensis.de
Tue Sep 4 15:25:08 PDT 2007
Yeah, it's a bug, already reported at "http://www.openlaszlo.org/jira/browse/LPP-4214".
If you add this instruction before you create the new dset-instance, you should get the right results:
lz.datapointer.prototype.ppcache={}
But sadly, this will clear the whole LzParsedPath-cache (you actually don't need to mind what that means).
Alternatively, you can also do this one which should give you better performance, because it won't clear the whole cache:
lz.datapointer.prototype.ppcache["ds:/phonebook/employee"] = null;
CC-ing Henry Minsky, because he is the data-guy for OpenLaszlo.
André
taocore wrote:
> For lazy loading, I have to create dataset dynamicly. But I found that
> destroy() method of dataset does not affect the view which use it as
> datapath. Event if after destorying the dataset, I created a new one
> with the same name, it seems that the view still associated with the
> destroyed old dataset. Try the code below on the laszlo explorer online.
> Any sugguestions would be much appreciated.
>
>
> <canvas debug="true">
>
> <class name="dset" extends="dataset"
>
> request="true" type="http"
>
> src="getemployees.jsp"/>
>
> <script>
>
> new dset(canvas, {name:'ds'});
>
> </script>
>
> <simplelayout axis="y"/>
>
>
>
> <view name="v" datapath="ds:/phonebook/employee">
>
> <simplelayout axis="x"/>
>
> <text datapath="firstName/text()"/>
>
> <text datapath="lastName/text()"/>
>
> <text datapath="phone/text()"/>
>
> </view>
>
>
> <view name="bbb" bgcolor="yellow">
>
> <simplelayout axis="x"/>
>
> <text datapath="firstName/text()"/>
>
> <text datapath="lastName/text()"/>
>
> <text datapath="phone/text()"/>
>
> </view>
>
>
> <button>ok
>
> <method event="onclick">
>
> var dp = ds.getPointer();
>
>
> dp.selectChild();
>
> dp.selectChild();
>
> Debug.write(dp.serialize());
>
> dp.deleteNode();
>
> dp.deleteNode();
>
> ds.abort();
>
> ds.destroy();
>
>
>
> new dset(canvas, {name:'ds'});
>
> Debug.write(ds.serialize());
>
> parent.bbb.setDatapath("ds:/phonebook/employee");
>
> ds.doRequest();
>
> </method>
>
> </button>
>
> </canvas>
>
>
>
>
> taocore
--
Official OpenLaszlo-Committer ^_^
More information about the Laszlo-user
mailing list