|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.repeater.AbstractRepeater
org.apache.wicket.markup.repeater.RepeatingView
org.apache.wicket.markup.repeater.RefreshingView
public abstract class RefreshingView
An abstract repeater view that provides refreshing functionality to its subclasses. The view is refreshed every request, making it well suited for displaying dynamic data.
The view is populated by implementing getItemModels() and
populateItem(Item) methods. RefreshingView builds the items that will be
rendered by looping over the models retrieved from getItemModels() and
calling the newItem(String, int, IModel) to generate the child item
container followed by a call to populateItem(Item) to let the user
populate the newly created item container with custom components.
The provided ModelIteratorAdapter can make implementing
getItemModels() easier if you have an iterator over item objects.
RepeatingView,
ModelIteratorAdapter,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.wicket.Component |
|---|
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor, Component.VisibilityChange |
| Field Summary |
|---|
| Fields inherited from class org.apache.wicket.Component |
|---|
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER |
| Constructor Summary | |
|---|---|
RefreshingView(java.lang.String id)
Constructor |
|
RefreshingView(java.lang.String id,
IModel model)
Constructor |
|
| Method Summary | |
|---|---|
protected void |
addItems(java.util.Iterator items)
Add items to the view. |
protected abstract java.util.Iterator |
getItemModels()
Returns an iterator over models for items that will be added to this view |
IItemReuseStrategy |
getItemReuseStrategy()
|
java.util.Iterator |
getItems()
|
protected Item |
newItem(java.lang.String id,
int index,
IModel model)
Factory method for Item container. |
protected void |
onPopulate()
Refresh the items in the view. |
protected abstract void |
populateItem(Item item)
Populate the given Item container. |
RefreshingView |
setItemReuseStrategy(IItemReuseStrategy strategy)
Sets the item reuse strategy. |
| Methods inherited from class org.apache.wicket.markup.repeater.RepeatingView |
|---|
newChildId, renderIterator |
| Methods inherited from class org.apache.wicket.markup.repeater.AbstractRepeater |
|---|
onBeforeRender, onRender, renderChild |
| Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer |
|---|
getMarkupType, getWebPage |
| Methods inherited from class org.apache.wicket.MarkupContainer |
|---|
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onComponentTagBody, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, toString, visitChildren, visitChildren |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RefreshingView(java.lang.String id)
id - component id
public RefreshingView(java.lang.String id,
IModel model)
id - component idmodel - model| Method Detail |
|---|
protected final void onPopulate()
onPopulate in class RepeatingViewAbstractRepeater.onPopulate()protected abstract java.util.Iterator getItemModels()
protected abstract void populateItem(Item item)
be carefull to add any components to the item and not the view itself. So, don't do:
add(new Label("foo", "bar"));
but:
item.add(new Label("foo", "bar"));
item - The item to populate
protected Item newItem(java.lang.String id,
int index,
IModel model)
id - component id for the new data itemindex - the index of the new data itemmodel - the model for the new data item
Itempublic java.util.Iterator getItems()
protected void addItems(java.util.Iterator items)
items - item instances to be added to this viewpublic IItemReuseStrategy getItemReuseStrategy()
DefaultItemReuseStrategy
if none was set.DefaultItemReuseStrategypublic RefreshingView setItemReuseStrategy(IItemReuseStrategy strategy)
Items.
strategy - item reuse strategy
IItemReuseStrategy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||