PDA

View Full Version : remove state doesnt destroy node


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>

hqm
08-26-2004, 11:56 AM
If you put the replicated view into an enclosing view, it seems to get removed:


<view x="100" id="updateme" initstage="defer" visible="false" width="150" height="150" bgcolor="red">
<state id="mystate">
<view name="foo">
<simplelayout axis="y" />
<text datapath="contacts:/phonebook/contact/" text="$path{'id/text()'}" />
</view>
<text>Hello</text>
<simplelayout axis="y" />
</state>
</view>


I'll have to find out if the current behavior is a bug or not.