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.
Parameters:
delegate
A forms technology dependent delegate needed to do the work.
uid
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).
    Parameters:
    noderef
    Returns:
    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.
    Parameters:
    instanceIndex
    The index (0 based) of the instance you wish to retrieve.
    Returns:
    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.
    Parameters:
    instanceReference
    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).
    Returns:
    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.
    Parameters:
    desiredCount
    The requeasted number of instances
    async
    [since 4.0,html only] Pass true to fire instance change events asynchronously.
    Returns:
    true if the instance count was modified successfully.