ps
10-17-2004, 01:59 PM
Hi,
please help me getting started. I have this code:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE canvas SYSTEM "http://www.laszlosystems.com/lps/tools/lzx.dtd">
<canvas width="400" height="300">
<dataset name="myds">
<prefs>
<mypref name="pref1" val="true"/>
<mypref name="pref2" val="true"/>
</prefs>
</dataset>
<class name="myView" extends="view" bgcolor="#999999" width="20" height="20">
<attribute name="a1"/>
<attribute name="a2"/>
<view width="${parent.width}" height="${parent.height}" bgcolor="red"/>
</class>
<class name="selector" extends="checkbox">
<method event="onvalue">
this.datapath.updateData();
</method>
<method name="updateData">
return this.value;
</method>
<method name="applyData" args="d">
this.setValue(d);
</method>
</class>
<view id="main">
<simplelayout axis="y" spacing="5"/>
<view id="select">
<simplelayout axis="y" spacing="5"/>
<view>
<datapath xpath="myds:/prefs/mypref" pooling="true"/>
<simplelayout axis="y"/>
<selector width="30" text="$path{'@name'}">
<datapath xpath="@val"/>
</selector>
</view>
</view>
<view id="show">
<simplelayout axis="y" spacing="5"/>
<myView a1="true" a2="false"/>
<myView a1="false" a2="false"/>
<myView a1="true" a2="true"/>
</view>
</view>
</canvas>
"myView" should only be visible if the "a1" or "a2" matches with the values of <prefs>. How can I achieve this, especially when I update the dataset?
Thanks a lot!
please help me getting started. I have this code:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE canvas SYSTEM "http://www.laszlosystems.com/lps/tools/lzx.dtd">
<canvas width="400" height="300">
<dataset name="myds">
<prefs>
<mypref name="pref1" val="true"/>
<mypref name="pref2" val="true"/>
</prefs>
</dataset>
<class name="myView" extends="view" bgcolor="#999999" width="20" height="20">
<attribute name="a1"/>
<attribute name="a2"/>
<view width="${parent.width}" height="${parent.height}" bgcolor="red"/>
</class>
<class name="selector" extends="checkbox">
<method event="onvalue">
this.datapath.updateData();
</method>
<method name="updateData">
return this.value;
</method>
<method name="applyData" args="d">
this.setValue(d);
</method>
</class>
<view id="main">
<simplelayout axis="y" spacing="5"/>
<view id="select">
<simplelayout axis="y" spacing="5"/>
<view>
<datapath xpath="myds:/prefs/mypref" pooling="true"/>
<simplelayout axis="y"/>
<selector width="30" text="$path{'@name'}">
<datapath xpath="@val"/>
</selector>
</view>
</view>
<view id="show">
<simplelayout axis="y" spacing="5"/>
<myView a1="true" a2="false"/>
<myView a1="false" a2="false"/>
<myView a1="true" a2="true"/>
</view>
</view>
</canvas>
"myView" should only be visible if the "a1" or "a2" matches with the values of <prefs>. How can I achieve this, especially when I update the dataset?
Thanks a lot!