com.extjs.gxt.ui.client.binding
Class FormBinding

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.binding.Bindings
          extended by com.extjs.gxt.ui.client.binding.FormBinding
All Implemented Interfaces:
Observable

public class FormBinding
extends Bindings

A Bindings subclass for forms.

If a store is specified, edits will done using record instances from the store, rather than editing the model directly. This allows all changes to be committed or rolled back in batch.


Field Summary
protected  FormPanel panel
           
protected  Store store
           
protected  boolean updateOriginalValue
           
 
Fields inherited from class com.extjs.gxt.ui.client.binding.Bindings
bindings, model
 
Constructor Summary
FormBinding(FormPanel panel)
          Creates a new form binding instance.
FormBinding(FormPanel panel, boolean autoBind)
          Creates a new form binding instance.
 
Method Summary
 void autoBind()
          Searches the form's fields, and adds a binding to and field without a binding.
 void bind(ModelData model)
          Binds the model instance.
 Store getStore()
          Returns the form binding's store.
 boolean isUpdateOriginalValue()
          Returns true if the field's original value are updated when the field is bound.
 void setStore(Store store)
          Sets the form binding's store.
 void setUpdateOriginalValue(boolean update)
          True to update the field's original value when bound (defaults to false).
 
Methods inherited from class com.extjs.gxt.ui.client.binding.Bindings
addFieldBinding, clear, getBinding, getBindings, getModel, removeFieldBinding, unbind
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, callListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

panel

protected FormPanel panel

store

protected Store store

updateOriginalValue

protected boolean updateOriginalValue
Constructor Detail

FormBinding

public FormBinding(FormPanel panel)
Creates a new form binding instance.

Parameters:
panel - the form panel

FormBinding

public FormBinding(FormPanel panel,
                   boolean autoBind)
Creates a new form binding instance.

Parameters:
panel - the form panel
autoBind - true to automatically add field bindings based on the forms field names
Method Detail

autoBind

public void autoBind()
Searches the form's fields, and adds a binding to and field without a binding.


bind

public void bind(ModelData model)
Description copied from class: Bindings
Binds the model instance.

Overrides:
bind in class Bindings
Parameters:
model - the model

getStore

public Store getStore()
Returns the form binding's store.

Returns:
the store

isUpdateOriginalValue

public boolean isUpdateOriginalValue()
Returns true if the field's original value are updated when the field is bound.

Returns:
true if original value is updated

setStore

public void setStore(Store store)
Sets the form binding's store. When set, edits will done using record instances from the store, rather than editing the model directly.

Parameters:
store - the store

setUpdateOriginalValue

public void setUpdateOriginalValue(boolean update)
True to update the field's original value when bound (defaults to false).

Parameters:
update - true to update the original value