Name

replicator

Synopsis

LZX: replicator
JavaScript: lz.replicator
Type: Class
Access: public
Topic: Components.Replicators
Declared in: lps/components/utils/replicator/replicator.lzx

Description

This is a declared replicator for visual elements. Unlike OpenLaszlo''s data-replication feature, a replicator can take an arbitrary node set that may be passed in as an array. Non-replicating elements may be used inside a replicator; only the last child inside the replicator is replicated. The data attribute of the replicated (cloned) view is set by the setData method with data from the nodes array when the clone is bound.

Superclass Chain

node (LzNode) » view (LzView) » replicator

Known Subclasses

Details

Properties (10)

axis
<attribute name="axis" type="string" value="y" />
public var axis : String;
The axis in which to replicate
clones
<attribute name="clones" />
public var clones;
The list of elements controlled by this repliator
container
<attribute name="container" />
public var container;
The view that will contain the replicated nodes. Defaults to the immediateparent of the replicator.
dataset
<attribute name="dataset" />
public var dataset;
Compute nodes from this dataset
mask
<attribute name="mask" />
public var mask;
The view that will clip the replicated nodes. Defaults to the immediateparent of the container
nodes
<attribute name="nodes" value="null" />
public var nodes;
The list of nodes over which this replictor acts
pool
<attribute name="pool" type="boolean" value="true" />
public var pool : boolean;
If true, then instances of the replicated instance are reused when possible
replicatedsize
<attribute name="replicatedsize" value="null" />
public var replicatedsize;
The size (width or height) in the replication axis of the view being replicated. Assumes all subviews have same replicated size.
spacing
<attribute name="spacing" value="0" />
public var spacing;
A pixel amount to use between each replicated view
xpath
<attribute name="xpath" type="string" />
public var xpath : String;
Compute nodes from this xpath query against the specified dataset

Methods (7)

bind()
<method name="bind" args="v, n" />
public function bind(v : LzView, n : Number);
Called internally, but may be overriden. This is the method which binds a given clone to an element in the nodes array.
ensureInView()
<method name="ensureInView" args="n" />
public function ensureInView(n : Number);
Ensures that the clone at the given offset is visible under the mask
getCloneForOffset()
<method name="getCloneForOffset" args="n" />
public function getCloneForOffset(n : Number);
Gets the clone for the given offset, scrolling it into view first if necessary.
insertNode()
<method name="insertNode" args="idx, n" />
public function insertNode(idx : Number, n : Object);
Insert a node in existing list of elements.
setData()
<method name="setData" args="v, n" />
public function setData(v : LzView, n);
Called internally, but may be overriden. This is the method is called to set the data of a clone to an element in the nodes array.
setNodes()
<method name="setNodes" args="n" />
public function setNodes(n : Array);
Replicate over the given list of elements
unbind()
<method name="unbind" args="v" />
public function unbind(v);
Called internally, but may be overriden. This method is called when a given clone is about to be pooled or destroyed

Events (1)

onnodes
<attribute name="onnodes" />
public event onnodes;

LZX Synopsis

<class name="lz.replicator" extends=" LzView ">
  <attribute name=" axis " type="string" value="y" />
  <attribute name=" clones " />
  <attribute name=" container " />
  <attribute name=" dataset " />
  <attribute name=" mask " />
  <attribute name=" nodes " value="null" />
  <attribute name=" pool " type="boolean" value="true" />
  <attribute name=" replicatedsize " value="null" />
  <attribute name=" spacing " value="0" />
  <attribute name=" xpath " type="string" />
  <method name=" bind " args="v, n" />
  <method name=" ensureInView " args="n" />
  <method name=" getCloneForOffset " args="n" />
  <method name=" insertNode " args="idx, n" />
  <event name=" onnodes " />
  <method name=" setData " args="v, n" />
  <method name=" setNodes " args="n" />
  <method name=" unbind " args="v" />
</class>

JavaScript Synopsis

public lz.replicator extends  LzView  {
  public var axis  : String;
  public var clones ;
  public var container ;
  public var dataset ;
  public var mask ;
  public var nodes ;
  public var pool  : boolean;
  public var replicatedsize ;
  public var spacing ;
  public var xpath  : String;
  prototype public function bind (v : LzView, n : Number);
  prototype public function ensureInView (n : Number);
  prototype public function getCloneForOffset (n : Number);
  prototype public function insertNode (idx : Number, n : Object);
  prototype public event onnodes ;
  prototype public function setData (v : LzView, n);
  prototype public function setNodes (n : Array);
  prototype public function unbind (v);
}