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 <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]>

Hostes alienigeni me abduxerunt. Qui annus est?

PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8  7175 14D3 6485 A99C EB6D

Attachment: pgpaa8np8ZyDL.pgp
Description: PGP signature

Reply via email to