jakeh
08-26-2004, 11:24 AM
Why doesnt this work and how would i get around it? mystate.remove() doesnt destroy the text item that is generated from the dataset. I am going to make a datapath so it chooses only the id that i want to display and removes the old one from the last selection.
::CODE::
<!DOCTYPE canvas SYSTEM "http://laszlosystems.com/lps/tools/lzx.dtd">
<canvas debug="true">
<dataset name="contacts">
<phonebook>
<contact>
<fullname>Kim Jones</fullname>
<id>001</id>
</contact>
<contact>
<fullname>George Jones</fullname>
<id>002</id>
</contact>
<contact>
<fullname>Albert Jones</fullname>
<id>003</id>
</contact>
<contact>
<fullname>Leslie Jones</fullname>
<id>004</id>
</contact>
<contact>
<fullname>Brian Jones</fullname>
<id>005</id>
</contact>
</phonebook>
</dataset>
<list>
<dataselectionmanager id="list1" />
<textlistitem>
<datapath xpath="contacts:/phonebook/contact/fullname/text()" />
<method event="onclick">
updateme.completeInstantiation();
updateme.setVisible(true);
mystate.remove();
</method>
<method event="ondblclick">
mystate.apply();
</method>
</textlistitem>
</list>
<view id="updateme" initstage="defer" visible="false" width="150" height="150" bgcolor="red">
<state id="mystate">
<text datapath="contacts:/phonebook/contact/" text="$path{'id/text()'}" />
<text>Hello</text>
<simplelayout axis="y" />
</state>
</view>
<simplelayout axis="x" />
</canvas>
::CODE::
<!DOCTYPE canvas SYSTEM "http://laszlosystems.com/lps/tools/lzx.dtd">
<canvas debug="true">
<dataset name="contacts">
<phonebook>
<contact>
<fullname>Kim Jones</fullname>
<id>001</id>
</contact>
<contact>
<fullname>George Jones</fullname>
<id>002</id>
</contact>
<contact>
<fullname>Albert Jones</fullname>
<id>003</id>
</contact>
<contact>
<fullname>Leslie Jones</fullname>
<id>004</id>
</contact>
<contact>
<fullname>Brian Jones</fullname>
<id>005</id>
</contact>
</phonebook>
</dataset>
<list>
<dataselectionmanager id="list1" />
<textlistitem>
<datapath xpath="contacts:/phonebook/contact/fullname/text()" />
<method event="onclick">
updateme.completeInstantiation();
updateme.setVisible(true);
mystate.remove();
</method>
<method event="ondblclick">
mystate.apply();
</method>
</textlistitem>
</list>
<view id="updateme" initstage="defer" visible="false" width="150" height="150" bgcolor="red">
<state id="mystate">
<text datapath="contacts:/phonebook/contact/" text="$path{'id/text()'}" />
<text>Hello</text>
<simplelayout axis="y" />
</state>
</view>
<simplelayout axis="x" />
</canvas>