|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry.spec.BaseLocatable org.apache.tapestry.AbstractComponent org.apache.tapestry.components.Foreach
public abstract class Foreach
Repeatedly renders its wrapped contents while iterating through a list of values. [Component Reference]
While the component is rendering, the property
value
(accessed as
components.foreach.value
is set to each successive value from the source,
and the property
index
is set to each successive index
into the source (starting with zero).
Constructor Summary | |
---|---|
Foreach()
|
Method Summary | |
---|---|
abstract String |
getElement()
|
int |
getIndex()
The index number, within the source , of the
the current value. |
abstract IBinding |
getIndexBinding()
|
abstract Object |
getSource()
|
protected Iterator |
getSourceData()
Gets the source binding and returns an Iterator
representing
the values identified by the source. |
Object |
getValue()
Returns the most recent value extracted from the source parameter. |
abstract IBinding |
getValueBinding()
|
protected void |
renderComponent(IMarkupWriter writer,
IRequestCycle cycle)
Gets the source binding and iterates through its values. |
Methods inherited from class org.apache.tapestry.spec.BaseLocatable |
---|
getLocation, setLocation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.tapestry.ILocationHolder |
---|
setLocation |
Methods inherited from interface org.apache.tapestry.ILocatable |
---|
getLocation |
Constructor Detail |
---|
public Foreach()
Method Detail |
---|
public abstract IBinding getIndexBinding()
protected Iterator getSourceData()
Iterator
representing
the values identified by the source. Returns an empty Iterator
if the binding, or the binding value, is null.
Invokes Tapestry.coerceToIterator(Object)
to perform
the actual conversion.
public abstract IBinding getValueBinding()
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
renderComponent
in class AbstractComponent
public Object getValue()
ApplicationRuntimeException
- if the Foreach is not currently rendering.public abstract String getElement()
public abstract Object getSource()
public int getIndex()
source
, of the
the current value.
ApplicationRuntimeException
- if the Foreach is not currently rendering.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |