Class Annotations.Forms.FieldManager
Annotations.Forms.FieldManager
Constructor Attributes | Constructor Name and Description |
---|---|
Annotations.Forms.FieldManager(annotationManager)
Represents a tree of PDF Forms fields.
|
Method Attributes | Method Name and Description |
---|---|
addField(field, update)
Adds the given field object to the field tree, either replacing or merging with any existing field.
|
|
calculate(field, index)
Equivalent to the given field's value changing, if it was at position index in the calculation order.
|
|
fieldChanged(event, field)
Listener for field value changes.
|
|
Gets the calculation order.
|
|
getField(name)
Gets a field whose full name matches the one that is given.
|
|
setCalculationOrder(order)
Set the calculation order - use this if you need changes in one field to trigger calculation events on other fields.
|
Class Detail
Annotations.Forms.FieldManager(annotationManager)
Represents a tree of PDF Forms fields. @see Annotations.Forms.Field
Allows adding, getting and visiting fields.
- Parameters:
- {CoreControls.AnnotationManager} annotationManager
Method Detail
{Annotations.Forms.Field}
addField(field, update)
Adds the given field object to the field tree, either replacing or merging with any existing field.
Note: if the field is merged, it is the equivalent of performing Annotations.Forms.Field.set on the existing field, followed by setting all the field's widgets' fields to the original field.
- Parameters:
- {(Annotations.Forms.Field|obj)} field
- The field or field-like object to add.
- {boolean} update Optional, Default: false
- Returns:
- {Annotations.Forms.Field} The field that was inserted into the field tree (may not be the field originally provided).
calculate(field, index)
Equivalent to the given field's value changing, if it was at position index in the calculation order.
- Parameters:
- {?Annotations.Forms.Field} field
- The field to set as source for the calculation event. May be null.
- {number} index Optional, Default: 0
- The index at which to start running the calculation order.
fieldChanged(event, field)
Listener for field value changes.
- Parameters:
- {*} event
- Currently ignored
- {Annotations.Forms.Field} field
- The field whose value changed.
{string[]}
getCalculationOrder()
Gets the calculation order. @see Annotations.Forms.FieldManager.setCalculationOrder
- Returns:
- {string[]} An array of field names.
{?(Annotations.Forms.Field|Annotations.WidgetAnnotation)}
getField(name)
Gets a field whose full name matches the one that is given. If No field matches, and the last part of the field name is a number, returns that index of the field's widget array.
- Parameters:
- {string} name
- The full name of the field to search for.
- Returns:
- {?(Annotations.Forms.Field|Annotations.WidgetAnnotation)} The field or widget, or null if no field matches.
setCalculationOrder(order)
Set the calculation order - use this if you need changes in one field to trigger calculation events on other fields.
If the name of field that is changed is before the name of another field, that other field is recalculated.
If the name of the field that has changed is not in the array, all the fields named by the arrya are recalculated in order.
- Parameters:
- {string[]} order
- An array of field names.