public interface BindingListModelExt<E> extends BindingListModel<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>
Modifier and Type | Method and Description |
---|---|
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.
|
indexOf
addListDataListener, getElementAt, getSize, removeListDataListener
int[] indexesOf(java.lang.Object obj)
obj
- the specified objectboolean isDistinct()
DataBinder
performance so there is no need
to scan the whole ListModel as long as find one.Copyright © 2005-2021 Potix Corporation. All Rights Reserved.