When a view's datapath matches more than one data node, one instance
of the view is created for each match. The replicated views are
referred to as clones' When this happens, a
replication manager (or a subclass of
LzReplicationManager
) is created to manage the
clones. Replication managers are never directly instantiated —
they are created when a datapath makes multiple matches.
If the replicated view was named, the clone manager takes over the named spot in the parent. The example below demonstrates this, and shows how to reference individual clones.
In the example that follows, a view, called
replView
is bound to a dataset
somedata
. For each matching node in the dataset, a
new view is created. These views contain the text of the dataset. In
other words, the single line
causes the creation of five views (because there were five elements
in the dataset that matched the selection criteria). These "cloned"
views are numbered successively, starting with zero. The highlited
section of the code below shows how to use the
getCloneNumber
method to access each replicated
view.
<canvas height="140"> <dataset name="somedata"> <one/> <two/> <three/> <four/> <five/> </dataset> <simplelayout/> <button onclick="moveClone()"> Move clone <attribute name="cnum" value="0"/> </button> <view name="replView" datapath="somedata:/*"> <text datapath="name()"/> </view> </canvas>
Properties (8)
Setters (3)
Setters for virtual properties, to be used with setAttribute. A setter may or may not have a corresponding getter method; consult the Methods list in this section.
Methods (4)
Copyright © 2002-2007 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.