org.apache.tapestry.components
Class Foreach

java.lang.Object
  extended byorg.apache.hivemind.impl.BaseLocatable
      extended byorg.apache.tapestry.AbstractComponent
          extended byorg.apache.tapestry.components.Foreach
All Implemented Interfaces:
IComponent, IRender, org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder

Deprecated. As of release 4.0, replaced by ForBean

public abstract class Foreach
extends AbstractComponent

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 indexis set to each successive index into the source (starting with zero).

Author:
Howard Lewis Ship

Constructor Summary
Foreach()
          Deprecated.  
 
Method Summary
protected  void cleanupAfterRender(IRequestCycle cycle)
          Deprecated. Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle)after the component renders.
abstract  java.lang.String getElement()
          Deprecated.  
 int getIndex()
          Deprecated. The index number, within the source, of the the current value.
protected  java.util.Iterator getSourceData()
          Deprecated. Gets the source binding and returns an Iteratorrepresenting the values identified by the source.
 java.lang.Object getValue()
          Deprecated. Returns the most recent value extracted from the source parameter.
abstract  ValueConverter getValueConverter()
          Deprecated.  
protected  void prepareForRender(IRequestCycle cycle)
          Deprecated. Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle)to prepare the component to render.
protected  void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
          Deprecated. Gets the source binding and iterates through its values.
abstract  void setIndexParameter(int value)
          Deprecated.  
abstract  void setValueParameter(java.lang.Object value)
          Deprecated.  
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, enterActiveState, finishLoad, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toString
 
Methods inherited from class org.apache.hivemind.impl.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.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

Foreach

public Foreach()
Deprecated. 
Method Detail

getSourceData

protected java.util.Iterator getSourceData()
Deprecated. 
Gets the source binding and returns an Iteratorrepresenting the values identified by the source. Returns an empty Iteratorif the binding, or the binding value, is null.

Invokes Tapestry#coerceToIterator(Object)to perform the actual conversion.


prepareForRender

protected void prepareForRender(IRequestCycle cycle)
Deprecated. 
Description copied from class: AbstractComponent
Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle)to prepare the component to render. This implementation sets JavaBeans properties from matching bound parameters. This implementation does nothing.

Overrides:
prepareForRender in class AbstractComponent

cleanupAfterRender

protected void cleanupAfterRender(IRequestCycle cycle)
Deprecated. 
Description copied from class: AbstractComponent
Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle)after the component renders. This implementation does nothing.

Overrides:
cleanupAfterRender in class AbstractComponent

renderComponent

protected void renderComponent(IMarkupWriter writer,
                               IRequestCycle cycle)
Deprecated. 
Gets the source binding and iterates through its values. For each, it updates the value binding and render's its wrapped elements.

Specified by:
renderComponent in class AbstractComponent

getValue

public java.lang.Object getValue()
Deprecated. 
Returns the most recent value extracted from the source parameter.

Throws:
org.apache.tapestry.ApplicationRuntimeException - if the Foreach is not currently rendering.

getIndex

public int getIndex()
Deprecated. 
The index number, within the source, of the the current value.

Throws:
org.apache.tapestry.ApplicationRuntimeException - if the Foreach is not currently rendering.
Since:
2.2

getElement

public abstract java.lang.String getElement()
Deprecated. 

setIndexParameter

public abstract void setIndexParameter(int value)
Deprecated. 
Since:
4.0

setValueParameter

public abstract void setValueParameter(java.lang.Object value)
Deprecated. 
Since:
4.0

getValueConverter

public abstract ValueConverter getValueConverter()
Deprecated. 
Since:
4.0