|
|
|
The lazy replicator example works when the container is a view, but not a <list> component. The <list> component has it's own simplelayout, which
seems to be interfering with the lazyreplicator's placement of clones. If I comment out the simplelayout in the list component class, then the explicit lazy replication example works with a list container. Maybe we need a protocol for the explicit replicator to override any layout in the parent container view. r6413 | hqm | 2007-09-08 20:22:45 -0400 (Sat, 08 Sep 2007) | 30 lines
Changed paths: M /openlaszlo/branches/wafflecone/lps/components/utils/replicator/lazyreplicator.lzx M /openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx M /openlaszlo/branches/wafflecone/test/explicit-replicators/floating-list.lzx M /openlaszlo/branches/wafflecone/test/explicit-replicators/lazy-replicator.lzx M /openlaszlo/branches/wafflecone/test/explicit-replicators/replicator.lzx M /openlaszlo/branches/wafflecone/test/explicit-replicators/selection.lzx M /openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx Change 20070908-hqm-0 by hqm@IBM-2E06404CB67 on 2007-09-08 09:30:54 EDT in /cygdrive/c/users/hqm/openlaszlo/wafflecone3 for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone Summary: fix for lazyreplicator when used with list component New Features: Bugs Fixed: Technical Reviewer: ptw (pending) QA Reviewer: (pending) Doc Reviewer: (pending) Documentation: Release Notes: Details: Take steps to disable any layouts in the container before instantiating the clones Note, also in this patch is changing of xpath attribute to string type ( under review in another patch) Tests: ------------------------------------------------------------------------ BAsed upon my testing, both windows draw their respective lists correctly, with no scrambling or blank lines.
Tested in build r6938, on IE7 Windows. Verified. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
component; the
case where the parent is a plain old view seems to scroll fine and instantiate
the nodes in order.
See test case below: the left side window works fine, the right side
has the bug.
So it seems the <list> is trying to manage the view order and
scrolling at the same time as the replicator?
<!-- Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. -->
<canvas debug="true" proxied="false">
<debug height="90%" width="40%" x="55%" y="5%" />
<dataset name="testdata">
<fibs>
<fib value="2" />
<fib value="3" />
<fib value="5" />
<fib value="8" />
<fib value="13" />
<fib value="21" />
<fib value="34" />
<fib value="55" />
<fib value="89" />
<fib value="144" />
<fib value="233" />
<fib value="377" />
<fib value="610" />
<fib value="987" />
<fib value="1597" />
<fib value="2584" />
<fib value="4181" />
<fib value="6765" />
<fib value="10946" />
<fib value="17711" />
<fib value="28657" />
<fib value="46368" />
<fib value="75025" />
<fib value="121393" />
<fib value="196418" />
<fib value="317811" />
<fib value="514229" />
</fibs>
</dataset>
<text multiline="true">
Compares selection behavior across replicators where the parent is
a view (had problems with parent being a list.) Be sure to test range
selection and scrolling at various speeds.
</text>
<window width="20%" height="20%" x="5%" y="5%" name="explicitlazyrepltest"
resizable="true" title="explicit lazy replicator">
<view>
<dataselectionmanager name="selman" id="dsel"/>
<lazyreplicator id="elr" dataset="testdata" xpath="fibs/fib">
<text width="100">
<attribute name="selected" value="false"/>
<attribute name="bgcolor"
value="${selected ? 0xCCDDEE : null }"/>
<attribute name="index" value="$path{'position()'}" />
<attribute name="value" value="$path{'@value'}" />
<method name="applyData">
this.format('%s: %d', this.index, this.value);
</method>
<handler name="onclick">
//Debug.write(parent.selman.isSelected( this ),
parent.selman.toggle);
parent.selman.select( this );
</handler>
<method name="setSelected" args="value">
this.selected = value;
this.onselected.sendEvent(value);
</method>
</text>
</lazyreplicator>
</view>
<scrollbar/>
</window>
<window width="20%" height="20%" x="30%" y="5%"
name="explicitlazyrepltest_sel"
resizable="true" title="explicit lazy replicator with LIST parent">
<list width="${immediateparent.width}" height="${immediateparent.height}">
<dataselectionmanager name="selman" id="dsel2"/>
<lazyreplicator id="elr2" dataset="testdata" xpath="fibs/fib">
<text width="100">
<attribute name="selected" value="false"/>
<attribute name="bgcolor"
value="${selected ? 0xCCDDEE : null }"/>
<attribute name="index" value="$path{'position()'}" />
<attribute name="value" value="$path{'@value'}" />
<method name="applyData">
this.format('%s: %d', this.index, this.value);
</method>
<handler name="onclick">
Debug.write(parent.selman.isSelected( this ), parent.selman.toggle);
parent.selman.select( this );
</handler>
<method name="setSelected" args="value">
this.selected = value;
this.onselected.sendEvent(value);
</method>
</text>
</lazyreplicator>
<!-- FIXME: [2007-08-10 ptw] (LPP-4484) -->
<!-- NOT WORKING scrollbar id="lsb" scrolltarget="immediateparent" -->
</list>
</window>
</canvas>