Form
A form bound to a model using well defined states and operations. The form contains a list of form items which are used to view and modify the attributes of the model. Form item can be bound or unbound. Bound form items show the attributes of the model (text input, check boxes or select boxes), whereas unbound form items have no relation to the model (static text or buttons).
Method Summary
Public Methods | ||
public |
cancel() Cancels any modifications to the model. |
|
public |
clear() Clears this form by removing the model reference and by clearing all form fields. |
|
public |
edit(model: T) Takes the specified model and populates the editing state with the values from the model. |
|
public |
save() Validates the form and its fields and upon successful validation persists the changes to the model and calls the save callback. |
|
public |
view(model: T) Takes the specified model and updates the read-only state with the values from the model. |
Public Methods
public clear() source
Clears this form by removing the model reference and by clearing all form fields.
public edit(model: T) source
Takes the specified model and populates the editing state with the values from the model.
Params:
Name | Type | Attribute | Description |
model | T | the model to edit. |
public save() source
Validates the form and its fields and upon successful validation persists the changes to the model and calls the save callback.
public view(model: T) source
Takes the specified model and updates the read-only state with the values from the model.
Params:
Name | Type | Attribute | Description |
model | T | the model to view. |