| java.lang.Object org.zkoss.zkplus.databind.DataBinder
All known Subclasses: org.zkoss.zkplus.databind.AnnotateDataBinder,
DataBinder | public class DataBinder (Code) | | The DataBinder used for binding ZK UI component and the backend data bean.
author: Henri Chen |
Method Summary | |
public void | addBinding(Component comp, String attr, String expr) Binding bean to UI component. | public void | addBinding(Component comp, String attr, String expr, String[] loadWhenEvents, String saveWhenEvent, String access, String converter) Binding bean to UI component. | public void | addBinding(Component comp, String attr, String expr, String[] loadWhenEvents, String[] saveWhenEvents, String access, String converter) Binding bean to UI component. | public void | addBinding(Component comp, String attr, String expr, List loadWhenEvents, String saveWhenEvent, String access, String converter) Binding bean to UI component. | public void | addBinding(Component comp, String attr, String expr, List loadWhenEvents, List saveWhenEvents, String access, String converter) Binding bean to UI component. | public void | addCollectionItem(String comp, CollectionItem decor) Adds a CollectionItem for this comp. | public void | bindBean(String beanid, Object bean) Bind a real bean object to the specified beanid. | public boolean | existBinding(Component comp, String attr) Whether this component and attribute associated with a binding. | boolean | existsBean(String beanid) | public boolean | existsBindings(Component comp) Whether this component associated with any bindings. | Object | getBean(String beanid) | Object | getBeanAndRegisterBeanSameNodes(Component comp, String path) traverse the path nodes and return the final bean. | Set | getBeanSameNodes(Object bean) | public Binding | getBinding(Component comp, String attr) Given component and attr, return the associated
Binding . | protected CollectionItem | getBindingCollectionItem(Component comp) Returns a CollectionItem by the comp accordingly. | public Collection | getBindings(Component comp) Given component, return the associated list of
Binding s. | static boolean | hasTemplateOwner(Component comp) | protected void | init() | static boolean | isClone(Component comp) | public boolean | isDefaultConfig() Whether use the default binding configuration. | static boolean | isTemplate(Component comp) | public void | loadAll() Load all value from data beans to UI components. | public void | loadAttribute(Component comp, String attr) Load value from the data bean property to a specified attribute of the UI component. | public void | loadComponent(Component comp) Load values from the data bean properties to all attributes of a specified UI component. | protected Object[] | loadPropertyAnnotation(Component comp, String propName, String bindName) | Object | lookupBean(Component comp, String beanid) | static Component | lookupClone(Component srcClone, Component srcTemplate) | static List | parseExpression(String expr, String separator) | Set | removeBeanSameNodes(Object bean) | public void | removeBinding(Component comp, String attr) Remove the binding associated with the attribute of the component. | public void | saveAll() Save all values from UI components to beans. | public void | saveAttribute(Component comp, String attr) Save value from a specified attribute of the UI component to a data bean property. | public void | saveComponent(Component comp) Save values from all attributes of a specified UI component to data bean properties. | void | setBean(String beanid, Object bean) | void | setBeanAndRegisterBeanSameNodes(Component comp, Object val, Binding binding, String path, boolean autoConvert, Object rawval, List loadOnSaveInfos) | void | setBeanSameNodes(Object bean, Set set) | public void | setDefaultConfig(boolean b) Whether use the default binding configuration. | public void | setupTemplateComponent(Component comp, Object owner) |
_collectionItemMap | protected Map _collectionItemMap(Code) | | |
addBinding | public void addBinding(Component comp, String attr, String expr)(Code) | | Binding bean to UI component. This is the same as
addBinding(Component comp, String attr, String expr, (List)null, (List)null, (String)null, (String)null).
Parameters: comp - The component to be associated. Parameters: attr - The attribute of the component to be associated. Parameters: expr - The expression to associate the data bean. |
addBinding | public void addBinding(Component comp, String attr, String expr, String[] loadWhenEvents, String saveWhenEvent, String access, String converter)(Code) | | Binding bean to UI component.
Parameters: comp - The component to be associated. Parameters: attr - The attribute of the component to be associated. Parameters: expr - The expression to associate the data bean. Parameters: loadWhenEvents - The event list when to load data. Parameters: saveWhenEvent - The event when to save data. Parameters: access - In the view of UI component: "load" load only, "both" load/save, "save" save only when doingdata binding. null means using the default access natural of the component. e.g. Label.value is "load", but Textbox.value is "both". Parameters: converter - The converter class used to convert classes between component and the associated bean. null means using the default class conversion method. |
addBinding | public void addBinding(Component comp, String attr, String expr, String[] loadWhenEvents, String[] saveWhenEvents, String access, String converter)(Code) | | Binding bean to UI component.
Parameters: comp - The component to be associated. Parameters: attr - The attribute of the component to be associated. Parameters: expr - The expression to associate the data bean. Parameters: loadWhenEvents - The event list when to load data. Parameters: saveWhenEvents - The event when to save data. Parameters: access - In the view of UI component: "load" load only, "both" load/save, "save" save only when doingdata binding. null means using the default access natural of the component. e.g. Label.value is "load", but Textbox.value is "both". Parameters: converter - The converter class used to convert classes between component and the associated bean. null means using the default class conversion method. since: 3.0.0 |
addBinding | public void addBinding(Component comp, String attr, String expr, List loadWhenEvents, String saveWhenEvent, String access, String converter)(Code) | | Binding bean to UI component.
Parameters: comp - The component to be associated. Parameters: attr - The attribute of the component to be associated. Parameters: expr - The expression to associate the data bean. Parameters: loadWhenEvents - The event list when to load data. Parameters: saveWhenEvent - The event when to save data. Parameters: access - In the view of UI component: "load" load only, "both" load/save, "save" save only when doingdata binding. null means using the default access natural of the component. e.g. Label.value is "load", but Textbox.value is "both". Parameters: converter - The converter class used to convert classes between component and the associated bean. null means using the default class conversion method. |
addBinding | public void addBinding(Component comp, String attr, String expr, List loadWhenEvents, List saveWhenEvents, String access, String converter)(Code) | | Binding bean to UI component.
Parameters: comp - The component to be associated. Parameters: attr - The attribute of the component to be associated. Parameters: expr - The expression to associate the data bean. Parameters: loadWhenEvents - The event list when to load data. Parameters: saveWhenEvents - The event list when to save data. Parameters: access - In the view of UI component: "load" load only, "both" load/save, "save" save only when doingdata binding. null means using the default access natural of the component. e.g. Label.value is "load", but Textbox.value is "both". Parameters: converter - The converter class used to convert classes between component and the associated bean. null means using the default class conversion method. since: 3.0.0 |
bindBean | public void bindBean(String beanid, Object bean)(Code) | | Bind a real bean object to the specified beanid. You might not need to call this method because this
DataBinder would look up the variable via the
org.zkoss.zk.ui.Component.getVariable method
if it cannot find the specified bean via the given beanid.
Parameters: beanid - The bean id used in data binding. Parameters: bean - The real bean object to be associated with the bean id. |
existBinding | public boolean existBinding(Component comp, String attr)(Code) | | Whether this component and attribute associated with a binding.
|
existsBindings | public boolean existsBindings(Component comp)(Code) | | Whether this component associated with any bindings.
|
getBeanAndRegisterBeanSameNodes | Object getBeanAndRegisterBeanSameNodes(Component comp, String path)(Code) | | traverse the path nodes and return the final bean.
|
getBinding | public Binding getBinding(Component comp, String attr)(Code) | | Given component and attr, return the associated
Binding .
Parameters: comp - the concerned component Parameters: attr - the concerned attribute |
getBindings | public Collection getBindings(Component comp)(Code) | | Given component, return the associated list of
Binding s.
Parameters: comp - the concerned component |
init | protected void init()(Code) | | |
isDefaultConfig | public boolean isDefaultConfig()(Code) | | Whether use the default binding configuration.
|
loadAll | public void loadAll()(Code) | | Load all value from data beans to UI components.
|
loadAttribute | public void loadAttribute(Component comp, String attr)(Code) | | Load value from the data bean property to a specified attribute of the UI component.
Parameters: comp - the UI component to be loaded value. Parameters: attr - the UI component attribute to be loaded value. |
loadComponent | public void loadComponent(Component comp)(Code) | | Load values from the data bean properties to all attributes of a specified UI component.
Parameters: comp - the UI component to be loaded value. |
removeBinding | public void removeBinding(Component comp, String attr)(Code) | | Remove the binding associated with the attribute of the component.
Parameters: comp - The component to be removed the data binding association. Parameters: attr - The attribute of the component to be removed the data binding association. |
saveAll | public void saveAll()(Code) | | Save all values from UI components to beans.
|
saveAttribute | public void saveAttribute(Component comp, String attr)(Code) | | Save value from a specified attribute of the UI component to a data bean property.
Parameters: comp - the UI component used to save value into backend data bean. Parameters: attr - the UI component attribute used to save value into backend data bean. |
saveComponent | public void saveComponent(Component comp)(Code) | | Save values from all attributes of a specified UI component to data bean properties.
Parameters: comp - the UI component used to save value into backend data bean. |
setDefaultConfig | public void setDefaultConfig(boolean b)(Code) | | Whether use the default binding configuration.
|
setupTemplateComponent | public void setupTemplateComponent(Component comp, Object owner)(Code) | | Sets up the specified comp and its decendents to be as template (or not)
|
|
|