org.apache.tapestry.components
Class ForBean

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.form.AbstractFormComponent
              extended by org.apache.tapestry.components.ForBean
All Implemented Interfaces:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, IFormComponent, IComponent, IRender

public abstract class ForBean
extends AbstractFormComponent

Author:
mb

Constructor Summary
ForBean()
           
 
Method Summary
abstract  IPrimaryKeyConverter getConverter()
           
abstract  DataSqueezer getDataSqueezer()
           
abstract  java.lang.Object getDefaultValue()
           
abstract  java.lang.String getElement()
           
abstract  ExpressionEvaluator getExpressionEvaluator()
           
abstract  java.lang.Object getFullSource()
           
abstract  java.util.Iterator getFullSourceIterator()
           
 int getIndex()
          The index number, within the source, of the the current value.
abstract  java.lang.String getKeyExpression()
           
abstract  java.lang.String getPrimaryKey()
           
abstract  java.util.Map getPrimaryKeyMap()
           
abstract  java.util.List getSavedSourceData()
           
abstract  java.lang.Object getSource()
           
protected  java.util.List getSourceData()
          Returns a List containing the values provided by the identified source binding.
abstract  java.util.List getSourcePrimaryKeys()
           
protected  java.util.Iterator getStoredData(IRequestCycle cycle, java.lang.String name)
          Returns a list of the values stored as Hidden fields in the form.
 java.lang.Object getValue()
          Returns the most recent value extracted from the source parameter.
abstract  ValueConverter getValueConverter()
           
abstract  boolean getVolatile()
           
 boolean isDisabled()
          Returns true if the component is disabled.
protected  void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
          Gets the source binding and iterates through its values.
protected  void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle)
           
protected  void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle)
           
abstract  void setFullSourceIterator(java.util.Iterator fullSourceIterator)
           
abstract  void setPrimaryKeyMap(java.util.Map primaryKeys)
           
abstract  void setSavedSourceData(java.util.List sourceData)
           
abstract  void setSourcePrimaryKeys(java.util.List sourcePrimaryKeys)
           
protected  java.util.Iterator storeSourceData(IForm form, java.lang.String name)
          Stores the provided data in the form and then returns the data as an iterator.
 
Methods inherited from class org.apache.tapestry.form.AbstractFormComponent
getCanTakeFocus, getForm, getIdParameter, getName, isRequired, renderDelegateAttributes, renderDelegatePrefix, renderDelegateSuffix, renderIdAttribute, setClientId, setForm, setName, setName
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, 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.tapestry.form.IFormComponent
getClientId, getDisplayName
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainer, setId, setNamespace, setPage, setProperty
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

ForBean

public ForBean()
Method Detail

getSource

public abstract java.lang.Object getSource()

getFullSource

public abstract java.lang.Object getFullSource()

getElement

public abstract java.lang.String getElement()

getVolatile

public abstract boolean getVolatile()

getDefaultValue

public abstract java.lang.Object getDefaultValue()

getPrimaryKey

public abstract java.lang.String getPrimaryKey()

getConverter

public abstract IPrimaryKeyConverter getConverter()

getKeyExpression

public abstract java.lang.String getKeyExpression()

getPrimaryKeyMap

public abstract java.util.Map getPrimaryKeyMap()

setPrimaryKeyMap

public abstract void setPrimaryKeyMap(java.util.Map primaryKeys)

getSourcePrimaryKeys

public abstract java.util.List getSourcePrimaryKeys()

setSourcePrimaryKeys

public abstract void setSourcePrimaryKeys(java.util.List sourcePrimaryKeys)

getSavedSourceData

public abstract java.util.List getSavedSourceData()

setSavedSourceData

public abstract void setSavedSourceData(java.util.List sourceData)

getFullSourceIterator

public abstract java.util.Iterator getFullSourceIterator()

setFullSourceIterator

public abstract void setFullSourceIterator(java.util.Iterator fullSourceIterator)

getDataSqueezer

public abstract DataSqueezer getDataSqueezer()

getValueConverter

public abstract ValueConverter getValueConverter()

getExpressionEvaluator

public abstract ExpressionEvaluator getExpressionEvaluator()

renderComponent

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

Overrides:
renderComponent in class AbstractFormComponent
See Also:
AbstractComponent.renderComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)

getSourceData

protected java.util.List getSourceData()
Returns a List containing the values provided by the identified source binding.

Returns:
a list with the values to iterate upon. null if conversion cannot be performed.

getStoredData

protected java.util.Iterator getStoredData(IRequestCycle cycle,
                                           java.lang.String name)
Returns a list of the values stored as Hidden fields in the form. A conversion is performed if the primary key of the value is stored.

Parameters:
cycle - The current request cycle
name - The name of the HTTP parameter whether the values
Returns:
an iterator with the values stored in the provided Hidden fields

storeSourceData

protected java.util.Iterator storeSourceData(IForm form,
                                             java.lang.String name)
Stores the provided data in the form and then returns the data as an iterator. If the primary key of the value can be determined, then that primary key is saved instead.

Parameters:
form - The form where the data will be stored
name - The name under which the data will be stored
Returns:
an iterator with the bound values stored in the form

getValue

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

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

getIndex

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

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

isDisabled

public boolean isDisabled()
Description copied from interface: IFormComponent
Returns true if the component is disabled. This is important when the containing form is submitted, since disabled parameters do not update their bindings.


renderFormComponent

protected void renderFormComponent(IMarkupWriter writer,
                                   IRequestCycle cycle)
Specified by:
renderFormComponent in class AbstractFormComponent

rewindFormComponent

protected void rewindFormComponent(IMarkupWriter writer,
                                   IRequestCycle cycle)
Specified by:
rewindFormComponent in class AbstractFormComponent