Class SfcInstanceManager

Class used to manage instances of repeatable blocks.

Class Summary
Constructor Attributes Constructor Name and Description
SfcInstanceManager(delegate, uid)
Constructs an instance manager.

Class Detail

SfcInstanceManager(delegate, uid)
Constructs an instance manager. Instance managers should not be constructed directly using this constructor but instead should be discovered through the sfc.findInstanceManager() method.
A forms technology dependent delegate needed to do the work.
The uid this instance manager was registered with.

Method Summary

Method Detail

  • addInstance()
    Adds a new instance. The new instance is added as the last child. Returns the newly added instance node or null if unable to add the instance.
  • findInstanceIndex(noderef)
    Given a node reference within an instance finds the index of the instance to which it belongs. (the node should not be within a nested repeat).
    The index (0 based) of the containing instance or -1 if unable to determine.
  • getAllInstances()
    Returns an array containing all the instances (nodes) managed by this instance manager.
  • getInstance(instanceIndex)
    Retrieves the instance at the specified index.
    The index (0 based) of the instance you wish to retrieve.
    Returns the instance or null if unable to retrieve.
  • getInstanceCount()
    Returns the number of instances currently instantiated.
  • getMax()
    Returns the maximum number of instances allowed or -1 if unbounded.
  • getMin()
    Returns the minimum number of instances allowed. (0 if no minimum).
  • removeInstance(instanceReference)
    Removes an existing instance.
    A reference to the instance to remove. can be either a) The index (0 based) of the instance you wish to remove. b) A noderef within the instance you want to remove (but not within a nested repeat).
    true if the instance was removed.
  • setInstanceCount(desiredCount, async)
    Modifies the current instance count to match the desired count. Instances are added or removed as needed to make the match the count.
    The requeasted number of instances
    [since 4.0,html only] Pass true to fire instance change events asynchronously.
    true if the instance count was modified successfully.