org.apache.tapestry.form
Class RadioGroup

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.form.AbstractRequirableField
                  extended by org.apache.tapestry.form.RadioGroup
All Implemented Interfaces:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, IFormComponent, RequirableField, IComponent, IRender

public abstract class RadioGroup
extends AbstractRequirableField

A special type of form component that is used to contain Radiocomponents. The Radio and Radiogroup components work together to update a property of some other object, much like a more flexible version of a PropertySelection. [ Component Reference ] As of 4.0, RadioGroup can indicate that it is required.

Author:
Howard Lewis Ship, Paul Ferraro

Constructor Summary
RadioGroup()
           
 
Method Summary
 void bind(IMarkupWriter writer, IRequestCycle cycle)
          Called on the field if the required field check succeeds.
protected  void cleanupAfterRender(IRequestCycle cycle)
          Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle)after the component renders.
protected  void finishLoad()
          Invoked, as a convienience, from AbstractComponent.finishLoad(IRequestCycle, IPageLoader, IComponentSpecification).
static RadioGroup get(IRequestCycle cycle)
           
 int getNextOptionId()
           
 boolean isRewinding()
           
 boolean isSelected(int option)
          Used by Radiocomponents when rewinding to see if their value was submitted.
 boolean isSelection(java.lang.Object value)
          Returns true if the value is equal to the current selection for the group.
protected  void prepareForRender(IRequestCycle cycle)
          Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle)to prepare the component to render.
protected  void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle)
           
 void updateSelection(java.lang.Object value)
          Invoked by the Radiowhich is selected to update the property bound to the selected parameter.
 
Methods inherited from class org.apache.tapestry.form.AbstractRequirableField
getRequirableFieldSupport, getSubmittedValue, rewindFormComponent, setRequiredMessage
 
Methods inherited from class org.apache.tapestry.form.AbstractFormComponent
getForm, getIdParameter, getName, renderComponent, renderDelegateAttributes, renderDelegatePrefix, renderDelegateSuffix, renderIdAttribute, select, setClientId, setForm, setName, setName
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, enterActiveState, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, 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.RequirableField
getRequiredMessage, isRequired
 
Methods inherited from interface org.apache.tapestry.form.IFormComponent
getClientId, getDisplayName, getForm, getName, isDisabled, setName
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, 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

RadioGroup

public RadioGroup()
Method Detail

get

public static RadioGroup get(IRequestCycle cycle)

getNextOptionId

public int getNextOptionId()

isRewinding

public boolean isRewinding()

isSelection

public boolean isSelection(java.lang.Object value)
Returns true if the value is equal to the current selection for the group. This is invoked by a Radioduring rendering to determine if it should be marked 'checked'.


updateSelection

public void updateSelection(java.lang.Object value)
Invoked by the Radiowhich is selected to update the property bound to the selected parameter.


isSelected

public boolean isSelected(int option)
Used by Radiocomponents when rewinding to see if their value was submitted.


prepareForRender

protected void prepareForRender(IRequestCycle cycle)
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
See Also:
AbstractComponent.prepareForRender(org.apache.tapestry.IRequestCycle)

cleanupAfterRender

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

Overrides:
cleanupAfterRender in class AbstractComponent
See Also:
AbstractComponent.cleanupAfterRender(org.apache.tapestry.IRequestCycle)

finishLoad

protected void finishLoad()
Description copied from class: AbstractComponent
Invoked, as a convienience, from AbstractComponent.finishLoad(IRequestCycle, IPageLoader, IComponentSpecification). This implemenation does nothing. Subclasses may override without invoking this implementation.

Overrides:
finishLoad in class AbstractComponent
See Also:
AbstractComponent.finishLoad()

bind

public void bind(IMarkupWriter writer,
                 IRequestCycle cycle)
          throws ValidatorException
Description copied from interface: RequirableField
Called on the field if the required field check succeeds.

Throws:
ValidatorException - if required field check fails.
See Also:
RequirableField.bind(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)

renderFormComponent

protected void renderFormComponent(IMarkupWriter writer,
                                   IRequestCycle cycle)
Overrides:
renderFormComponent in class AbstractRequirableField
See Also:
AbstractRequirableField.renderFormComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)