[Laszlo-user] Dynamically creating views from XML

J B moatas at gmail.com
Wed Apr 26 15:54:05 EDT 2006


I have a scenario where I am trying to draw a series of small squares of
different colors.  I am getting the information as to what color and
position from an xml file.  However, I am having difficulty using the
information to set the color.

<canvas width="600" height="600" debug="false">
    <include href="/incubator/tooltip/tooltip.lzx" />
    <dataset name="dset" src="data.xml" />

    <class name="pixel" extends="view" width="5" height="5">
        <method event="onmouseover"></method>
        <method event="onmouseout"></method>
    </class>

    <class name="row" extends="view" width="100" height="5">
        <view datapath="dset:/nodes/node">
            <pixel bgcolor="${@color}" x="${@x}" y="${@y}">
                <tooltip text="${@tooltip}" />
            </pixel>
        </view>
    </class>

    <window width="100" height="100" resizable="true">
        <row />
    </window>
</canvas>

In he above code, I want to set the color attribute of the pixel class to
the color attribute found in the dataset, but I cannot seem to access it in
this manner.  Can anyone shed some light on how I might do this?

Thanks!

Birch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-user/attachments/20060426/b58af448/attachment.html


More information about the Laszlo-user mailing list