performance-tuning-$11.lzx

<canvas height="200" width="100%">
  <dataset name="letters">
    <item value="a">A</item>
    <item value="b">B</item>
    <item value="c">C</item>
    <item value="d">D</item>
    <item value="e">E</item>
    <item value="f">F</item>
  </dataset>

  <dataset name="numbers">
    <item value="1">I</item>
    <item value="2">II</item>
    <item value="3">III</item>
    <item value="4">IV</item>
    <item value="5">V</item>
    <item value="6">VI</item>
  </dataset>

  <simplelayout axis="x" spacing="60" inset="20"/>
  <method name="toggle" args="list">
    var xpath = list.datapath.xpath;
    if (xpath == "letters:/") {
      list.setAttribute("datapath", "numbers:/");
    } else {
      list.setAttribute("datapath", "letters:/");
    }
  </method>

  <view y="10" layout="class: simplelayout; axis: y; spacing: 5">
    <text>(list1)</text>

    <button name="toggle" text="toggle list1">
      <handler name="onclick">
        canvas.toggle(list1);
      </handler>
    </button>

    <list id="list1" width="130" shownitems="6" datapath="letters:/">
      <textlistitem datapath="/item" text="$path{'text()'}" value="$path{'@value'}"/>
    </list>
  </view>

  <view y="10" layout="class: simplelayout; axis: y; spacing: 5">
    <text>(list2) dataoption="pooling"</text>

    <button name="toggle" text="toggle list2">
      <handler name="onclick">
        canvas.toggle(list2);
      </handler>
    </button>

    <list id="list2" width="130" shownitems="6" datapath="letters:/" dataoption="pooling">
      <textlistitem datapath="/item" text="$path{'text()'}" value="$path{'@value'}"/>
    </list>
  </view>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2007, 2008 Laszlo Systems, Inc.  All Rights Reserved.                   *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->

Cross References

Named Instances