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 |
type
Scenario |
The scenario to use when binding entities |
Methods
- cancelButton ( id )
-
Attach cancel Scenario behaviour to specified button DOM element.
Parameters:
paramsName Type Description id typestringThe id of the button DOM element detailsExample
examples
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:
paramsName Type Description formId typestringThe id of the form DOM element. detailsReturns:returns tableType Description typebooleanWhether the unbind action was successful or not. - loadButton ( id )
-
Attach execute Scenario behaviour to specified button DOM element.
Parameters:
paramsName Type Description id typestringThe id of the button DOM element details - onDataSaved ( callback )
-
Attach a callback that will be called on save of any element associated with this AutoForm instance.
Parameters:
paramsName Type Description callback typeAutoForm~OnDataSavedCallbackCalled when an entity has been successfully updated details - runButton ( id )
-
Attach execute Scenario behaviour to specified button DOM element.
Parameters:
paramsName Type Description id typestringThe id of the button DOM element details - saveButton ( id )
-
Attach save View behaviour to specified button DOM element.
Parameters:
paramsName Type Description id typestringThe id of the button DOM element details
Type Definitions
-
AutoFormElementConfig - {
typeObject }
-
Data structure for a single AutoForm entity definition.details
Properties:
propertiesName Type Argument Description entityName typestringoptional The entity name if this element is an entity. parameterName typestringoptional The parameter name if this is a parameter. indices typeArray.<?>optional Array of indices. editorValidate typeAutoForm~EditorValidationCallbackoptional Callback to validate the element. - EditorValidationCallback ( name, value ) → {Result}
-
Parameters:
paramsName Type Description name typestringEntity name. value type*Value to validate. detailsReturns:returns tableType Description typeResultThe validation result and message if there is an error. - OnDataSavedCallback ( scenario, entity, value )
-
Callback for AutoForm#onDataSaved.
Parameters:
paramsName Type Description scenario typeScenarioThe form's scenario entity typeModelEntityThe form element's entity. Passes undefined if it is an Insight Parameter type value typestring | objectEither 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 details
© 2001-2019 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.