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.RadioGroup
All Implemented Interfaces:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, IFormComponent, ValidatableField, IComponent, IDirectEvent, Component, IRender

public abstract class RadioGroup
extends AbstractFormComponent
implements 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

Field Summary
 
Fields inherited from class org.apache.tapestry.AbstractComponent
_body, _bodyCount
 
Constructor Summary
RadioGroup()
           
 
Method Summary
protected  void cleanupAfterRender(IRequestCycle cycle)
          Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle)after the component renders.
static RadioGroup get(IRequestCycle cycle)
           
protected  boolean getCanTakeFocus()
          This component can not take focus.
 int getNextOptionId()
           
abstract  ValidatableFieldSupport getValidatableFieldSupport()
          Injected.
 boolean isRequired()
          Returns false.
 boolean isRewinding()
           
 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(IRequestCycle cycle)
          Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle)to prepare the component to render.
protected  void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle)
          Invoked from AbstractFormComponent.renderComponent(IMarkupWriter, IRequestCycle) to render the component.
protected  void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle)
          Invoked from AbstractFormComponent.renderComponent(IMarkupWriter, IRequestCycle) to rewind the component.
 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
generateClientId, getForm, getIdParameter, getName, getRenderBodyOnRewind, peekClientId, renderComponent, renderDelegateAttributes, renderDelegatePrefix, renderDelegateSuffix, setForm, setName, setName
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, enterActiveState, equals, finishLoad, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getBoundId, getClientId, getComponent, getComponents, getContainedComponent, getContainedRenderers, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getInnerRenderers, getListeners, getMessages, getNamespace, getPage, getRenderWorker, getSpecification, getSpecifiedId, getTemplateTagName, hasEvents, hashCode, isInActiveState, isParameterBound, isRendering, isStateful, pageEndRender, render, renderBody, renderIdAttribute, renderInformalParameters, setBinding, setClientId, setContainedComponent, setContainer, setHasEvents, setId, setNamespace, setPage, setTemplateTagName, toString, triggerEvent
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, 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, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getSpecification, getSpecifiedId, getTemplateTagName, isRendering, peekClientId, renderBody, setBinding, setClientId, setContainedComponent, setContainer, setId, setNamespace, setPage, setTemplateTagName
 
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(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(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. The default implementation of this method is empty.

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.

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

renderFormComponent

protected void renderFormComponent(IMarkupWriter writer,
                                   IRequestCycle cycle)
Description copied from class: AbstractFormComponent
Invoked from AbstractFormComponent.renderComponent(IMarkupWriter, IRequestCycle) to render the component.

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

rewindFormComponent

protected void rewindFormComponent(IMarkupWriter writer,
                                   IRequestCycle cycle)
Description copied from class: AbstractFormComponent
Invoked from AbstractFormComponent.renderComponent(IMarkupWriter, IRequestCycle) to rewind the component. If the component is disabled this will not be invoked.

Specified by:
rewindFormComponent in class AbstractFormComponent
See Also:
AbstractFormComponent.rewindFormComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle)

getValidatableFieldSupport

public abstract ValidatableFieldSupport getValidatableFieldSupport()
Injected.


isRequired

public boolean isRequired()
Description copied from class: AbstractFormComponent
Returns false. Subclasses that might be required must override this method. Typically, this involves checking against the component's validators.

Specified by:
isRequired in interface IFormComponent
Overrides:
isRequired in class AbstractFormComponent
See Also:
AbstractFormComponent.isRequired()

getCanTakeFocus

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

Overrides:
getCanTakeFocus in class AbstractFormComponent


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.