new Form(input)
- See:
-
- App.form for creating forms in different modes
Creates instance of App.form
Parameters:
Name | Type | Description |
---|---|---|
input |
object | configuration parameters for the form. |
Methods
_addFormTemplate(form)
Instantiate the form template toolbar
Parameters:
Name | Type | Description |
---|---|---|
form |
Object | instance |
_postRenderFormTemplate(A)
Set the control data to empty object to match with normal execution after submission.
Parameters:
Name | Type | Description |
---|---|---|
A |
object | control object that provided by the alpaca to get the form instance and values. |
destroy()
Destroy's this form instance including event listeners.
getAllFieldInstances() → {Object}
Returns all field instances from a form
Returns:
field instances associated with this form
- Type
- Object
getFieldInstanceByDataIdentifier(dataIdentifier, invertFieldNameMapping) → {*}
Parameters:
Name | Type | Default | Description |
---|---|---|---|
dataIdentifier |
|||
invertFieldNameMapping |
true
|
Returns:
- Type
- *
getInputElementByDataIdentifer(dataIdentifier) → {*}
Parameters:
Name | Type | Description |
---|---|---|
dataIdentifier |
Returns:
- Type
- *
getObjectId() → {String}
Returns:
objectId The objectId associated with this form
- Type
- String
renderFormWithTemplateData(data)
Render the form with selected template.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object | form template data to render |
setFieldRequired(field, requiredopt)
Set Alpaca form field mandatory
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
field |
Object | Alpaca form field |
||
required |
boolean |
<optional> |
true
|
indicates if the field should be required, i.e. mandatory |
toggleEditMode(e)
Toggle the form between 'EDIT' and 'VIEW' mode
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | An optional event that fired the toggle action. |
updateValueByDataIdentifier(label, value, dataIdentifier)
Updates the value of the form with the given dataIdentifier. Note other widgets with the same dataIdentifier will be updated as well.
Parameters:
Name | Type | Description |
---|---|---|
label |
||
value |
||
dataIdentifier |