|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.extjs.gxt.ui.client.binding.FieldBinding
public class FieldBinding
A two-way binding between a ModelData and Field instance. The binding will be 1-way when the bound model does not support change events.
ModelData
,
Field
Field Summary | |
---|---|
protected Field |
field
|
protected ModelData |
model
|
protected java.lang.String |
property
|
protected Store |
store
|
Constructor Summary | |
---|---|
FieldBinding(Field field,
java.lang.String property)
Creates a new binding instance. |
Method Summary | |
---|---|
void |
bind(ModelData model)
Binds the model and field. |
Converter |
getConverter()
Returns the bindings converter. |
Field<java.lang.Object> |
getField()
Returns the bound field. |
ModelData |
getModel()
Returns the bound model instance. |
java.lang.String |
getProperty()
Returns the model's bound property name. |
Store |
getStore()
Returns the binding's store. |
boolean |
isUpdateOriginalValue()
Returns true if the field's original value is updated when the field is bound. |
protected java.lang.Object |
onConvertFieldValue(java.lang.Object value)
|
protected java.lang.Object |
onConvertModelValue(java.lang.Object value)
|
protected void |
onFieldChange(FieldEvent e)
|
protected void |
onModelChange(PropertyChangeEvent event)
|
void |
setConverter(Converter converter)
Sets the converter which is used to translate data types when updating either the field or model. |
void |
setStore(Store<? extends ModelData> store)
Sets the store for the binding. |
void |
setUpdateOriginalValue(boolean updateOriginalValue)
True to update the field's original value when bound (defaults to false). |
void |
unbind()
Unbinds the model and field by removing all listeners. |
void |
updateField()
Updates the field's value with the model value. |
void |
updateField(boolean updateOriginalValue)
Updates the field's value and original value with the model value. |
void |
updateModel()
Updates the model's value with the field value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Field field
protected ModelData model
protected java.lang.String property
protected Store store
Constructor Detail |
---|
public FieldBinding(Field field, java.lang.String property)
field
- the bound field for the bindingMethod Detail |
---|
public void bind(ModelData model)
model
- the model to be boundpublic Converter getConverter()
public Field<java.lang.Object> getField()
public ModelData getModel()
public java.lang.String getProperty()
public Store getStore()
public boolean isUpdateOriginalValue()
public void setConverter(Converter converter)
converter
- the converterpublic void setStore(Store<? extends ModelData> store)
store
- the storepublic void setUpdateOriginalValue(boolean updateOriginalValue)
updateOriginalValue
- true to update the original valuepublic void unbind()
public void updateField()
public void updateField(boolean updateOriginalValue)
updateOriginalValue
- true to update the original valuepublic void updateModel()
protected java.lang.Object onConvertFieldValue(java.lang.Object value)
protected java.lang.Object onConvertModelValue(java.lang.Object value)
protected void onFieldChange(FieldEvent e)
protected void onModelChange(PropertyChangeEvent event)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |