contactlist.lzx

<!--=======================================================================-->
<!--                                                                       -->
<!-- contactlist.lzx                                                       -->
<!--                                                                       -->
<!-- Laszlo Application Language (LZX) Example                             -->
<!--                                                                       -->
<!-- Display a list from a datasource (xml file)                           -->
<!-- Open details panel with more info from datasource                     -->
<!-- Concepts: databinding, datareplication, dynamic layout, animation     -->
<!--                                                                       -->
<!--                                                                       -->
<!--=======================================================================-->
<canvas bgcolor="#eaeaea" width="176" height="208">

    <dataset name="mydata">
        <resultset>
            <result displayname="Sinbad" email="chep@arwins.com" work_address="565 Laurel Canyon" work_webpage="http://www.openlaszlo.org/"/>
            <result displayname="Really, Yahoo Laszlo" email="yah@sirius.com" work_address="5443 East 56th Street" work_webpage="http://www.openlaszlo.org/"/>
            <result displayname="Antun Karlovac" email="antun@karlovac.com" work_address="2321 Russell St #3G" work_webpage="http://www.openlaszlo.org/"/>
            <result displayname="Bret Simister" email="bsimister@foo.com" work_address="1 Boynton Ct." work_webpage="http://www.openlaszlo.org/"/>
        </resultset>
    </dataset>

    <class name="row" extends="tabelement">
        <handler name="ondata">
            var dp = this.datapath;
            this.setAttribute("text", dp.p.attributes["displayname"]);
            v.email.setAttribute("text", dp.p.attributes["email"]);
            v.addr.setAttribute("text", dp.p.attributes["work_address"]);
            v.web.setAttribute("text", dp.p.attributes["work_webpage"]);
        </handler>
        <view name="v" x="4" width="100%">
            <text name="email" width="100%"/>
            <text name="addr" width="100%"/>
            <text name="web" width="100%"/>
            <simplelayout axis="y"/>
        </view>
    </class>

    <view name="contactsborder" bgcolor="0x676767" width="176" height="208">
        <text name="test" x="5" y="1" fgcolor="white">contacts</text>
        <tabslider datapath="mydata:/resultset" defaultselection="0" x="2" y="20" width="174" height="${208 - parent.test.height}">
            <row datapath="result[1-4]"/>
        </tabslider>
    </view>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2006 Laszlo Systems, Inc.  All Rights Reserved.                   *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@                                                          -->

Cross References

Classes

Named Instances