[Laszlo-user] propriety of using data field in a view

Elliot Winard enw at laszlosystems.com
Wed Sep 5 11:10:02 PDT 2007


If I have a bunch of instances of data-bound views (or class instances) 
that access the object's .data property.  This is not a documented field 
in LzView or LzNode but I started using it when I caught [ondata] 
events.  See example below.

My question is.... is it safe to refer to the data property of a 
data-bound view?  If so, I'll log a LPP bug that it should be documented.

Thanks!
-e

<canvas height="500" debug="true">
    <dataset name="ds">
        <item name="Harry" />
        <item name="Ron" />
        <item name="Hermione" />
    </dataset>

    <button text="set data one" 
onclick="myview.setDatapath('ds:/item[1]')" />
    <button text="set data many" onclick="myview.setDatapath('ds:/item')" />

    <view name="myview">
        <datapath />
        <handler name="ondata" args="d">
            // code does stuff based on this.data here
            Debug.write("ondata", d, this.data);
        </handler>
        <text datapath="@name" />
    </view>

    <simplelayout />
</canvas>



More information about the Laszlo-user mailing list