[Laszlo-user] Explicit datapath setting issue

Robin Sheat robin at kallisti.net.nz
Tue Jul 3 01:07:05 PDT 2007


Hi, I'm trying to set the datapath of a component explicitly, however the 
change doesn't seem to be doing anything. I call setDatapath on it, with the 
datapath taken from another component.

This test case shows what I'm trying to do. When the button is clicked, I'd 
expect the datapath of the first one to match the second one, but this isn't 
happening.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE canvas SYSTEM "http://www.openlaszlo.org/lps-latest/tools/lzx.dtd">
<canvas width="500" height="500" debug="true">

	<class name="mytext">
		<attribute name="content" value="$path{'@desc'}" />
		<text text="${parent.content}" />
	</class>

	<dataset name="test">
		<test1 desc="wrong">
			<test2 desc="right" />
		</test1>
	</dataset>
	
	<simplelayout axis="y" />
	
	<view name="texts" datapath="test:/test1">
		<simplelayout axis="y"/>
		<mytext name="text1" />
		<mytext name="text2" datapath="test2" />
	</view>
	
	<button text="Make Right">
		<handler name="onclick"><![CDATA[
			Debug.write("Old text1 dp:",canvas.texts.text1.datapath);
			Debug.write("Old text2 dp:",canvas.texts.text2.datapath);
			var dp = canvas.texts.text2.datapath;
			canvas.texts.text1.setDatapath(dp);
			Debug.write("New text1 dp:",canvas.texts.text1.datapath);
		]]></handler>
	</button>
	
</canvas>


-- 
Robin <robin at kallisti.net.nz> JabberID: <eythian at jabber.kallisti.net.nz>

Hostes alienigeni me abduxerunt. Qui annus est?

PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8  7175 14D3 6485 A99C EB6D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.openlaszlo.org/pipermail/laszlo-user/attachments/20070703/0922387d/attachment.bin


More information about the Laszlo-user mailing list