| org.zkoss.zul.ListitemRendererExt
All known Subclasses: org.zkoss.zkplus.databind.BindingListitemRenderer,
Field Summary | |
final public static int | DETACH_ON_RENDER Returned by
ListitemRendererExt.getControls to indicate
to detach the list cell adde by
ListitemRendererExt.newListcell . | final public static int | DETACH_ON_UNLOAD Returned by
ListitemRendererExt.getControls to indicate
whether to detach a rendered item when unloading it.
When an item has to be cleaned up
(so it can be re-rendered again), the list box
checks whether this flag is returned.
For example, when a new data model is assigned, all rendered items
(i.e., generated by
ListitemRenderer.render ) will be cleaned up.
To have the best performance,
the list box, by default, keep using the same list item and
the first list cell (other list cells, if any, are removed).
Sometimes it could be an issue. |
Method Summary | |
public int | getControls() Returns how a listbox shall render the live data. | public Listcell | newListcell(Listitem item) Create an instance of
Listcell as the first cell of the list item.
Note: remember to invoke
Listcell.applyProperties to initialize
the properties, defined in the component definition, properly.
Note: DO NOT call
Listitem.setParent .
Don't create cells for other columns.
If null is returned, the default list cell is created as follow.
final Listcell cell = new Listcell();
cell.applyProperties();
return cell;
Note: DO NOT call
Listcell.setParent .
Parameters: item - the list item. | public Listitem | newListitem(Listbox listbox) Creates an instance of
Listitem for rendering. |
DETACH_ON_UNLOAD | final public static int DETACH_ON_UNLOAD(Code) | | Returned by
ListitemRendererExt.getControls to indicate
whether to detach a rendered item when unloading it.
When an item has to be cleaned up
(so it can be re-rendered again), the list box
checks whether this flag is returned.
For example, when a new data model is assigned, all rendered items
(i.e., generated by
ListitemRenderer.render ) will be cleaned up.
To have the best performance,
the list box, by default, keep using the same list item and
the first list cell (other list cells, if any, are removed).
Sometimes it could be an issue. For example, you assign attributes
or annotations to a rendered item.
Then, you'd better to return this flag to indicate that.
a new list item shall be created (by calling
ListitemRendererExt.newListitem and
ListitemRendererExt.newListcell )
to replace the renderred item.
|
newListcell | public Listcell newListcell(Listitem item)(Code) | | Create an instance of
Listcell as the first cell of the list item.
Note: remember to invoke
Listcell.applyProperties to initialize
the properties, defined in the component definition, properly.
Note: DO NOT call
Listitem.setParent .
Don't create cells for other columns.
If null is returned, the default list cell is created as follow.
final Listcell cell = new Listcell();
cell.applyProperties();
return cell;
Note: DO NOT call
Listcell.setParent .
Parameters: item - the list item. It is the same as that is returnedby ListitemRendererExt.newListitem the list cell if you'd like to create it differently, or nullif you want Listbox to create it for you |
newListitem | public Listitem newListitem(Listbox listbox)(Code) | | Creates an instance of
Listitem for rendering.
The created component will be passed to
ListitemRenderer.render .
Note: remember to invoke
Listitem.applyProperties to initialize
the properties, defined in the component definition, properly.
If null is returned, the default list item is created as follow.
final Listitem item = new Listitem();
item.applyProperties();
return item;
Note: DO NOT call
Listitem.setParent .
the list item if you'd like to create it differently, or nullif you want Listbox to create it for you |
|
|