|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BindingListModelExt<E>
Support same object in multiple items of a ListModel.
To speed up performance, DataBinder used to find only the first item of a given bean (see
BindingListModel.indexOf(java.lang.Object)
). However, in some cases, there might be one object in multiple items which
will cause "unexpected" results of data binding (i.e. While one change should cause multiple
items to be updated in Grid, we saw only one item is updated.). Therefore,
since version 3.1, we now support a "distinct" annotation that you can specify in model attribute
of collection components (i.e. Grid, Listbox, Combobox, etc.). So the data binder knows how to handle
your ListModel. The default value for "distinct" is true so the Data Binder behaves as usual. If you
specify distinct=false, the Data Binder will scan the whole ListModel to find all items that matches
and thus will be some performance issue if processing a big ListModel.
Example:
<grid model="@{persons,distinct=false}">
...
</grid>
Method Summary | |
---|---|
int[] |
indexesOf(java.lang.Object obj)
Deprecated. Returns indexes of the given object inside a ListModel. |
boolean |
isDistinct()
Deprecated. Returns true if all objects inside this ListModel is distinct. |
Methods inherited from interface org.zkoss.zkplus.databind.BindingListModel |
---|
indexOf |
Methods inherited from interface org.zkoss.zul.ListModel |
---|
addListDataListener, getElementAt, getSize, removeListDataListener |
Method Detail |
---|
int[] indexesOf(java.lang.Object obj)
obj
- the specified object
boolean isDistinct()
DataBinder
performance so there is no need
to scan the whole ListModel as long as find one.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |