net.sf.tacos.ajax.components
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 net.sf.tacos.ajax.components.RadioGroup
All Implemented Interfaces:
Locatable, LocationHolder, org.apache.tapestry.form.IFormComponent, org.apache.tapestry.form.ValidatableField, org.apache.tapestry.IComponent, org.apache.tapestry.IRender

public abstract class RadioGroup
extends org.apache.tapestry.form.AbstractFormComponent
implements org.apache.tapestry.form.ValidatableField

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, this component can be validated.

Author:
Howard Lewis Ship, Paul Ferraro

Constructor Summary
RadioGroup()
           
 
Method Summary
protected  void cleanupAfterRender(org.apache.tapestry.IRequestCycle cycle)
           
static RadioGroup get(org.apache.tapestry.IRequestCycle cycle)
          Gets the radio group
protected  boolean getCanTakeFocus()
          This component can not take focus.
 int getNextOptionId()
          Generates next radio option id
abstract  org.apache.tapestry.form.ValidatableFieldSupport getValidatableFieldSupport()
          Injected.
 boolean isRequired()
           
 boolean isRewinding()
          Whether or not rewinding
 boolean isSelected(int option)
          Used by Radiocomponents when rewinding to see if their value was submitted.
 boolean isSelection(Object value)
          Returns true if the value is equal to the current selection for the group.
protected  void prepareForRender(org.apache.tapestry.IRequestCycle cycle)
           
protected  void renderFormComponent(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
           
protected  void rewindFormComponent(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
           
 void updateSelection(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.AbstractFormComponent
getAlwaysRenderBodyOnRewind, getForm, getIdParameter, getName, renderComponent, renderDelegateAttributes, renderDelegatePrefix, renderDelegateSuffix, renderIdAttribute, setClientId, setForm, setName, setName
 
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.tapestry.form.ValidatableField
getValidators
 
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, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainedComponent, 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(org.apache.tapestry.IRequestCycle cycle)
Gets the radio group

Parameters:
cycle -
Returns:

getNextOptionId

public int getNextOptionId()
Generates next radio option id

Returns:

isRewinding

public boolean isRewinding()
Whether or not rewinding

Returns:

isSelection

public boolean isSelection(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(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(org.apache.tapestry.IRequestCycle cycle)
Overrides:
prepareForRender in class org.apache.tapestry.AbstractComponent
See Also:
AbstractComponent.prepareForRender(org.apache.tapestry.IRequestCycle)

cleanupAfterRender

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

renderFormComponent

protected void renderFormComponent(org.apache.tapestry.IMarkupWriter writer,
                                   org.apache.tapestry.IRequestCycle cycle)
Specified by:
renderFormComponent in class org.apache.tapestry.form.AbstractFormComponent
See Also:
org.apache.tapestry.form.AbstractRequirableField#renderFormComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)

rewindFormComponent

protected void rewindFormComponent(org.apache.tapestry.IMarkupWriter writer,
                                   org.apache.tapestry.IRequestCycle cycle)
Specified by:
rewindFormComponent in class org.apache.tapestry.form.AbstractFormComponent
See Also:
AbstractFormComponent.rewindFormComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)

getValidatableFieldSupport

public abstract org.apache.tapestry.form.ValidatableFieldSupport getValidatableFieldSupport()
Injected.


isRequired

public boolean isRequired()
Specified by:
isRequired in interface org.apache.tapestry.form.IFormComponent
Overrides:
isRequired in class org.apache.tapestry.form.AbstractFormComponent
See Also:
AbstractFormComponent.isRequired()

getCanTakeFocus

protected boolean getCanTakeFocus()
This component can not take focus.

Overrides:
getCanTakeFocus in class org.apache.tapestry.form.AbstractFormComponent