com.primix.tapestry.form
Class RadioGroup

java.lang.Object
  |
  +--com.primix.tapestry.AbstractComponent
        |
        +--com.primix.tapestry.form.AbstractFormComponent
              |
              +--com.primix.tapestry.form.RadioGroup
All Implemented Interfaces:
IComponent, IFormComponent, IRender

public class RadioGroup
extends AbstractFormComponent

A special type of form component that is used to contain Radio components. The Radio and Radio group components work together to update a property of some other object, much like a more flexible version of a PropertySelection.
Parameter Type Read / Write Required Default Description
selected Object R / W yes   Read during rendering to determine which Radio will be the default. Updated during rewinding (when the form is submitted) to indicate which radio button was selected by the user.
disabled boolean R no no If true, then all contained Radio components will be disabled as well.

Informal parameters are not allowed.

Version:
$Id: RadioGroup.java,v 1.8 2001/08/28 20:33:41 hship Exp $
Author:
Howard Ship

Fields inherited from class com.primix.tapestry.AbstractComponent
id, page, specification, wrapped, wrappedCount
 
Constructor Summary
RadioGroup()
           
 
Method Summary
static RadioGroup get(IRequestCycle cycle)
           
 IBinding getDisabledBinding()
           
 java.lang.String getName()
          Returns the name of the component, which is automatically generated during renderring.
 int getNextOptionId()
           
 IBinding getSelectedBinding()
           
 boolean isDisabled()
          Used by Radio components wrapped by this RadioGroup to see if the group as a whole is disabled.
 boolean isRewinding()
           
 boolean isSelected(int option)
          Used by Radio components 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.
 void render(IResponseWriter writer, IRequestCycle cycle)
          Doesn't actual render an HTML element ...
 void setDisabledBinding(IBinding value)
           
 void setSelectedBinding(IBinding value)
           
 void updateSelection(java.lang.Object value)
          Invoked by the Radio which is selected to update the property bound to the selected parameter.
 
Methods inherited from class com.primix.tapestry.form.AbstractFormComponent
getForm, getForm
 
Methods inherited from class com.primix.tapestry.AbstractComponent
addAsset, addComponent, addWrapped, cleanupAfterRender, cleanupComponent, finishLoad, finishLoad, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getChangeObserver, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getPage, getSpecification, prepareForRender, renderWrapped, reset, setBinding, setContainer, setId, setPage, setSpecification, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.primix.tapestry.IComponent
addAsset, addComponent, addWrapped, finishLoad, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getPage, getSpecification, renderWrapped, setBinding, setContainer, setId, setPage, setSpecification
 

Constructor Detail

RadioGroup

public RadioGroup()
Method Detail

get

public static RadioGroup get(IRequestCycle cycle)

getSelectedBinding

public IBinding getSelectedBinding()

setSelectedBinding

public void setSelectedBinding(IBinding value)

getDisabledBinding

public IBinding getDisabledBinding()

setDisabledBinding

public void setDisabledBinding(IBinding value)

getName

public java.lang.String getName()
Description copied from interface: IFormComponent
Returns the name of the component, which is automatically generated during renderring.

This value is set inside the component's render method and is not cleared. If the component is inside a Foreach, the value returned is the most recent name generated for the component.

This property is made available to facilitate writing JavaScript that allows components (in the client web browser) to interact.

In practice, a Script component works with the Body component to get the JavaScript code inserted and referenced.

Overrides:
getName in class AbstractFormComponent

getNextOptionId

public int getNextOptionId()

isDisabled

public boolean isDisabled()
Used by Radio components wrapped by this RadioGroup to see if the group as a whole is disabled.

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 Radio during rendering to determine if it should be marked 'checked'.

updateSelection

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

isSelected

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

render

public void render(IResponseWriter writer,
                   IRequestCycle cycle)
            throws RequestCycleException
Doesn't actual render an HTML element ... there is no direct equivalent for an HTML element. A RadioGroup component exists to organize the Radio components it wraps (directly or indirectly). A Radio can finds its RadioGroup as a IRequestCycle attribute.