AutoForm
Method summary
name | description |
---|---|
cancelButton | Attach cancel Scenario behaviour to specified button DOM element. |
clearBindings | Clear existing form bindings. |
loadButton | Attach execute Scenario behaviour to specified button DOM element. |
onDataSaved | Attach a callback on data saving completion. |
runButton | Attach execute Scenario behaviour to specified button DOM element. |
saveButton | Attach save View behaviour to specified button DOM element. |
Constructor
Create new AutoForm component.
Parameters:
Name | Type | Description |
---|---|---|
scenario | Scenario | The scenario to use when binding entities |
Methods
- cancelButton ( id )
-
Attach cancel Scenario behaviour to specified button DOM element.
Parameters:
Name Type Description id string The id of the button DOM element Example
Back to Topvar form = new AutoForm(firstScenario); form.cancelButton('cancel-btn-id');
- clearBindings ( formId ) → {boolean}
-
Clear existing form bindings. This will clear the _formBindings property on the object.
Parameters:
Name Type Description formId string The id of the form DOM element. Returns:Type Description boolean Whether the unbind action was successful or not. - loadButton ( id )
-
Attach execute Scenario behaviour to specified button DOM element.
Parameters:
Name Type Description id string The id of the button DOM element - onDataSaved ( callback )
-
Attach a callback that will be called on save of any element associated with this AutoForm instance.
Parameters:
Name Type Description callback AutoForm~OnDataSavedCallback Called when an entity has been successfully updated - runButton ( id )
-
Attach execute Scenario behaviour to specified button DOM element.
Parameters:
Name Type Description id string The id of the button DOM element - saveButton ( id )
-
Attach save View behaviour to specified button DOM element.
Parameters:
Name Type Description id string The id of the button DOM element
Type Definitions
- AutoFormElementConfig - { Object }
-
Data structure for a single AutoForm entity definition.
Properties:
Name Type Argument Description entityName string optional The entity name if this element is an entity. parameterName string optional The parameter name if this is a parameter. indices Array.<?> optional Array of indices. editorValidate AutoForm~EditorValidationCallback optional Callback to validate the element. - EditorValidationCallback ( name, value ) → {Result}
-
Parameters:
Name Type Description name string Entity name. value * Value to validate. Returns:Type Description Result The validation result and message if there is an error. - OnDataSavedCallback ( scenario, entity, value )
-
Callback for AutoForm#onDataSaved.
Parameters:
Name Type Description scenario Scenario The form's scenario entity ModelEntity The form element's entity. Passes undefined if it is an Insight Parameter type value string | object Either a single value string or a composite key-value pair, in the case of an array) for the value saved. If removal of an array element then the value will be an empty string
© 2001-2024 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.