Home Manual Reference Source
public class | source

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).

Member Summary

Public Members
public get

model: T

public get
public get

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 Members

public get model: T source

Return:

T

the current model.

public get transient source

public get undefined source

Public Methods

public cancel() source

Cancels any modifications to the model.

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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
model T

the model to view.