com.extjs.gxt.ui.client.widget.form
Class RadioGroup

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.form.Field<D>
                      extended by com.extjs.gxt.ui.client.widget.form.MultiField<Radio>
                          extended by com.extjs.gxt.ui.client.widget.form.RadioGroup
All Implemented Interfaces:
Observable, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget

public class RadioGroup
extends MultiField<Radio>

A group of Radio's.

Events:
Change : FieldEvent(field, value, oldValue)
Fires after a child radio is selected.


Nested Class Summary
 class RadioGroup.RadioGroupMessages
          TextField Messages.
 
Nested classes/interfaces inherited from class com.extjs.gxt.ui.client.widget.form.Field
Field.FieldImages, Field.FieldMessages
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.extjs.gxt.ui.client.widget.form.MultiField
fields, lc, orientation, spacing, validator
 
Fields inherited from class com.extjs.gxt.ui.client.widget.form.Field
autoValidate, emptyText, errorIcon, fieldStyle, focusStyle, focusValue, forceInvalidText, hasFocus, images, invalidStyle, messages, name, originalValue, preventMark, propertyEditor, readOnly, readOnlyFieldStyle, validationDelay, validationTask, value
 
Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width
 
Fields inherited from class com.extjs.gxt.ui.client.widget.Component
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
RadioGroup()
          Creates a new radio group.
RadioGroup(java.lang.String name)
          Creates a new radio group.
 
Method Summary
 void add(Radio radio)
           
 RadioGroup.RadioGroupMessages getMessages()
          Returns the field's messages.
 Radio getValue()
          Returns the selected radio.
 boolean isSelectionRequired()
          Returns true if a selection is required.
 boolean isValid(boolean preventMark)
          Returns whether or not the field value is currently valid.
 void markInvalid(java.lang.String msg)
          Marks this field as invalid.
protected  void onRadioSelected(Radio radio)
           
protected  void onRender(com.google.gwt.user.client.Element target, int index)
          Subclasses must override and ensure setElement is called for lazy rendered components.
protected  void setAriaState(java.lang.String stateName, java.lang.String stateValue)
           
 void setSelectionRequired(boolean selectionRequired)
          Sets whether a selection is required when validating the group (defaults to false).
 void setValue(Radio value)
          Sets a data value into the field and validates it.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.form.MultiField
add, clear, doAttachChildren, doDetachChildren, get, getAll, getInputEl, getOrientation, getSpacing, getValidator, isResizeFields, notifyHide, notifyShow, onBrowserEvent, onComponentEvent, onDisable, onEnable, onResize, reset, setOrientation, setReadOnly, setResizeFields, setSpacing, setValidator, validateValue
 
Methods inherited from class com.extjs.gxt.ui.client.widget.form.Field
addInputStyleName, addKeyListener, afterRender, alignErrorIcon, clearInvalid, createComponentEvent, findLabelElement, fireChangeEvent, fireKey, focus, forceInvalid, getAutoValidate, getEmptyText, getErrorMessage, getFieldLabel, getImages, getLabelSeparator, getLabelStyle, getMessageTarget, getName, getOriginalValue, getPropertyEditor, getRawValue, getStyleEl, getValidateOnBlur, getValidationDelay, initValue, isDirty, isFireChangeEventOnSetValue, isHideLabel, isInEditor, isReadOnly, isValid, onBlur, onClick, onDetach, onFocus, onHide, onKeyDown, onKeyPress, onKeyUp, onShow, removeInputStyleName, removeKeyListener, setAutoValidate, setEmptyText, setFieldLabel, setFireChangeEventOnSetValue, setHideLabel, setImages, setInEditor, setInputStyleAttribute, setLabelSeparator, setLabelStyle, setMessages, setMessageTarget, setName, setOriginalValue, setPropertyEditor, setRawValue, setTabIndex, setValidateOnBlur, setValidationDelay, updateOriginalValue, validate, validate
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
adjustPosition, adjustSize, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onPosition, onUnload, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addAttachable, addListener, addPlugin, addStyleName, addStyleOnOver, addWidgetListener, applyState, assertAfterRender, assertPreRender, beforeRender, blur, clearState, createObservable, createStyles, disable, disableContextMenu, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, frame, getAriaSupport, getBaseStyle, getBorders, getContextMenu, getData, getElement, getFocusEl, getFocusSupport, getHideMode, getId, getItemId, getListeners, getModel, getObservable, getPlugins, getState, getStateId, getTabIndex, getTitle, getToolTip, getWindowResizeDelay, hasListeners, hasListeners, hide, hideToolTip, initState, isDisabledEvents, isDisableTextSelection, isEnabled, isMasked, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, mask, onAttach, onDetachHelper, onEnsureDebugId, onHideContextMenu, onLoad, onRightClick, onShowContextMenu, onWindowResize, previewEvent, recalculate, removeAllListeners, removeAttachagle, removeFromParent, removeListener, removeStyleName, removeStyleOnOver, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setAriaRole, setAriaSupport, setBorders, setContextMenu, setData, setEl, setElement, setElement, setEnabled, setFiresEvents, setHideMode, setId, setIntStyleAttribute, setItemId, setModel, setMonitorWindowResize, setParent, setStateful, setStateId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, setWindowResizeDelay, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unframe, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RadioGroup

public RadioGroup()
Creates a new radio group.


RadioGroup

public RadioGroup(java.lang.String name)
Creates a new radio group.

Parameters:
name - the group name
Method Detail

add

public void add(Radio radio)

getMessages

public RadioGroup.RadioGroupMessages getMessages()
Description copied from class: Field
Returns the field's messages.

Overrides:
getMessages in class Field<Radio>
Returns:
the messages

getValue

public Radio getValue()
Returns the selected radio.

Overrides:
getValue in class Field<Radio>
Returns:
the fields value

isSelectionRequired

public boolean isSelectionRequired()
Returns true if a selection is required.

Returns:
the selection required state

isValid

public boolean isValid(boolean preventMark)
Description copied from class: Field
Returns whether or not the field value is currently valid.

Overrides:
isValid in class MultiField<Radio>
Parameters:
preventMark - true for silent validation (no invalid event and field is not marked invalid)
Returns:
true if the value is valid, otherwise false

markInvalid

public void markInvalid(java.lang.String msg)
Description copied from class: Field
Marks this field as invalid. Validation will still run if called again, and the error message will be changed or cleared based on validation. To set a error message that will not be cleared until manually cleared see Field.forceInvalid(String)

Overrides:
markInvalid in class Field<Radio>
Parameters:
msg - the validation message

setSelectionRequired

public void setSelectionRequired(boolean selectionRequired)
Sets whether a selection is required when validating the group (defaults to false).

Parameters:
selectionRequired - true to require a selection

setValue

public void setValue(Radio value)
Description copied from class: Field
Sets a data value into the field and validates it. If the field is rendered, To set the value directly without validation see Field.setRawValue(java.lang.String).

Overrides:
setValue in class Field<Radio>
Parameters:
value - the value to set

onRadioSelected

protected void onRadioSelected(Radio radio)

onRender

protected void onRender(com.google.gwt.user.client.Element target,
                        int index)
Description copied from class: Component
Subclasses must override and ensure setElement is called for lazy rendered components.

Overrides:
onRender in class MultiField<Radio>
Parameters:
target - the target element
index - the insert location

setAriaState

protected void setAriaState(java.lang.String stateName,
                            java.lang.String stateValue)
Overrides:
setAriaState in class Component