This doesn't answer your question but explains why you cannot use a local dataset in your situation. When you have a local dataset in a class, the dataset can only be addressed in children of the class, e.g.:
<canvas debug="true">
<class name="myclass">
<dataset name="myds">
<root>
<property name="applyshadow" defaultvalue="false" type="boolean" />
</root>
</dataset>
<text datapath="local:classroot.myds:/root/property[@name='applyshadow']/@defaultvalue" />
</class>
<myclass />
</canvas>
The <text>
element can access the dataset of the parent class by prepending local:
to the datapath value. If you don't select a name for your dataset, OpenLaszlo will automatically use the name localdata
for the dataset. Datasets using that name can be addressed by omitting the dataset name in the datapath/xpath value, e.g.
<class name="myclass">
<dataset>
<root>
<property name="applyshadow" defaultvalue="false" type="boolean" />
</root>
</dataset>
<text datapath="local:classroot:/root/property[@name='applyshadow']/@defaultvalue" />
</class>
Note that the datapath does not have a name and that the datapath used for the <text>
component is now local:classroot:/root/...
, while local:classroot.localdata:/root/...
would work as well.
I don't understand the design decision which makes it impossible to allow the use a local dataset in the datapath of a class containing that dataset, but maybe there were some technical reasons (initialization order, etc.) for it.