Class WRadioButtonSelect
- java.lang.Object
-
- com.github.bordertech.wcomponents.AbstractWComponent
-
- com.github.bordertech.wcomponents.WBeanComponent
-
- com.github.bordertech.wcomponents.AbstractInput
-
- com.github.bordertech.wcomponents.AbstractWSelectList
-
- com.github.bordertech.wcomponents.AbstractWSingleSelectList
-
- com.github.bordertech.wcomponents.WRadioButtonSelect
-
- All Implemented Interfaces:
AjaxTarget
,AjaxTrigger
,BeanAware
,BeanBound
,BeanProviderBound
,DataBound
,Diagnosable
,Disableable
,Input
,Labelable
,Mandatable
,MultiInputComponent
,SubordinateTarget
,SubordinateTrigger
,WComponent
,WebComponent
,Serializable
public class WRadioButtonSelect extends AbstractWSingleSelectList implements AjaxTrigger, AjaxTarget, SubordinateTrigger, SubordinateTarget, MultiInputComponent
WRadioButtonSelect is a convenience class which presents a group of radio buttons for the user to select one option from. Unlike
WRadioButton
, an explicitRadioButtonGroup
and individual labels for the radio buttons do not need to be provided. The visual arrangement of the radio buttons can be configured using thesetButtonLayout(Layout)
method.- Since:
- 1.0.0
- Author:
- Yiannis Paschalidis, Jonathan Austin
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WRadioButtonSelect.Layout
An enumeration of button layouts.static class
WRadioButtonSelect.RadioButtonSelectModel
Holds the extrinsic state information of the component.-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWSelectList
AbstractWSelectList.SelectionModel
-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractInput
AbstractInput.InputModel
-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWComponent
AbstractWComponent.WComponentRef
-
-
Field Summary
Fields Modifier and Type Field Description static WRadioButtonSelect.Layout
LAYOUT_COLUMNS
A layout where buttons are placed in columns.static WRadioButtonSelect.Layout
LAYOUT_FLAT
A layout where buttons are placed horizontally.static WRadioButtonSelect.Layout
LAYOUT_STACKED
A layout where buttons are placed vertically.-
Fields inherited from class com.github.bordertech.wcomponents.AbstractWSingleSelectList
EMPTY
-
Fields inherited from interface com.github.bordertech.wcomponents.WComponent
DEFAULT_APPLICATION_ID, DEFAULT_INTERNAL_ID, DEFAULT_NO_ID, ID_CONTEXT_SEPERATOR, ID_FRAMEWORK_ASSIGNED_SEPERATOR, ID_VALIDATION_PATTERN
-
-
Constructor Summary
Constructors Constructor Description WRadioButtonSelect()
Creates an empty WRadioButtonSelect.WRadioButtonSelect(Object table)
Creates a WRadioButtonSelect with the options provided by the given crt.WRadioButtonSelect(Object[] options)
Creates a WRadioButtonSelect with the specified options.WRadioButtonSelect(List options)
Creates a WRadioButtonSelect with the specified options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AjaxTarget
getAjaxTarget()
Retrieves the default AJAX target.int
getButtonColumns()
WRadioButtonSelect.Layout
getButtonLayout()
protected WRadioButtonSelect.RadioButtonSelectModel
getComponentModel()
Returns the effective component model for this component.protected WRadioButtonSelect.RadioButtonSelectModel
getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified.boolean
isAjax()
Indicates whether this component is AJAX enabled.boolean
isFrameless()
protected WRadioButtonSelect.RadioButtonSelectModel
newComponentModel()
Creates a new Component model.void
setAjaxTarget(AjaxTarget ajaxTarget)
Sets the default AJAX target for this list.void
setButtonColumns(int numColumns)
Sets the layout to be a certain number of columns.void
setButtonLayout(WRadioButtonSelect.Layout layout)
Sets the layout.void
setFrameless(boolean frameless)
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWSingleSelectList
doHandleInvalidOption, doHandleRequest, getData, getNewSelection, getRequestValue, getSelected, getValue, hasSelection, preparePaintComponent, setData, setSelected
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWSelectList
getCode, getDesc, getDescEncode, getListCacheKey, getLookupTable, getOptionIndex, getOptions, isAllowNoSelection, isEditable, isPresent, isSelectionOrderable, isSubmitOnChange, optionToCode, optionToCode, optionToString, setDescEncode, setEditable, setLookupTable, setOptions, setOptions, setSubmitOnChange
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractInput
addValidator, beforeHandleRequest, createMandatoryDiagnostic, doHandleChanged, getActionCommand, getActionObject, getActionOnChange, getDefaultSubmitButton, getDiagnostics, getValidators, getValueAsString, handleRequest, isChangedInLastRequest, isCurrentAjaxTrigger, isDisabled, isEmpty, isMandatory, isReadOnly, setActionObject, setActionOnChange, setChangedInLastRequest, setDefaultSubmitButton, setDisabled, setMandatory, setMandatory, setReadOnly, showErrorIndicatorsForComponent, showIndicatorsForComponent, showWarningIndicatorsForComponent, toString, validateComponent
-
Methods inherited from class com.github.bordertech.wcomponents.WBeanComponent
addBeanToScratchMap, doUpdateBeanValue, getBean, getBeanFromScratchMap, getBeanId, getBeanProperty, getBeanProvider, getBeanScratchMap, getBeanValue, isBeanInScratchMap, isChanged, isSearchAncestors, isUseRequestScopeScratchMap, removeBeanFromScratchMap, resetData, setBean, setBeanId, setBeanProperty, setBeanProvider, setSearchAncestors, updateBeanValue
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWComponent
addHtmlClass, addHtmlClass, addNotify, afterPaint, assertAddSupported, beforePaint, createErrorDiagnostic, createErrorDiagnostic, forward, getAccessibleText, getAttribute, getBaseUrl, getDefaultModel, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getScratchMap, getTabIndex, getTag, getTemplate, getTemplateMarkUp, getToolTip, hasNoComponentModel, hasTabIndex, initialiseComponentModel, invokeLater, invokeLaters, isDebugStructure, isDefaultState, isFlagSet, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, paintComponent, preparePaint, removeAttribute, removeComponentModel, removeHtmlClass, removeHtmlClass, removeNotify, replaceWComponent, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFlag, setFocussed, setHidden, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showWarningIndicators, tidyUpUIContext, tidyUpUIContextForTree, validate, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.bordertech.wcomponents.BeanAware
getBean, getBeanProperty, getBeanValue, setBeanProperty
-
Methods inherited from interface com.github.bordertech.wcomponents.BeanBound
isSearchAncestors, setBean
-
Methods inherited from interface com.github.bordertech.wcomponents.BeanProviderBound
getBeanId, setBeanId, setBeanProvider
-
Methods inherited from interface com.github.bordertech.wcomponents.WComponent
addHtmlClass, addHtmlClass, forward, getAccessibleText, getAttribute, getBaseUrl, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getTabIndex, getTag, getToolTip, handleRequest, hasTabIndex, invokeLater, isDefaultState, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, preparePaint, removeAttribute, removeHtmlClass, removeHtmlClass, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFocussed, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showWarningIndicators, tidyUpUIContextForTree, validate
-
-
-
-
Field Detail
-
LAYOUT_FLAT
public static final WRadioButtonSelect.Layout LAYOUT_FLAT
A layout where buttons are placed horizontally. Convenience constant forWRadioButtonSelect.Layout.FLAT
.
-
LAYOUT_STACKED
public static final WRadioButtonSelect.Layout LAYOUT_STACKED
A layout where buttons are placed vertically. Convenience constant forWRadioButtonSelect.Layout.STACKED
.
-
LAYOUT_COLUMNS
public static final WRadioButtonSelect.Layout LAYOUT_COLUMNS
A layout where buttons are placed in columns. Convenience constant forWRadioButtonSelect.Layout.COLUMNS
.
-
-
Constructor Detail
-
WRadioButtonSelect
public WRadioButtonSelect()
Creates an empty WRadioButtonSelect.
-
WRadioButtonSelect
public WRadioButtonSelect(Object[] options)
Creates a WRadioButtonSelect with the specified options.- Parameters:
options
- the radio button options.
-
WRadioButtonSelect
public WRadioButtonSelect(List options)
Creates a WRadioButtonSelect with the specified options.- Parameters:
options
- the radio button options.
-
WRadioButtonSelect
public WRadioButtonSelect(Object table)
Creates a WRadioButtonSelect with the options provided by the given crt.- Parameters:
table
- the table to obtain the group's options from.
-
-
Method Detail
-
setButtonLayout
public void setButtonLayout(WRadioButtonSelect.Layout layout)
Sets the layout.- Parameters:
layout
- the layout.
-
setButtonColumns
public void setButtonColumns(int numColumns)
Sets the layout to be a certain number of columns.- Parameters:
numColumns
- the number of columns.
-
getButtonColumns
public int getButtonColumns()
- Returns:
- the number of columns for layout. Only applies to LAYOUT_COLUMNS layout.
-
getButtonLayout
public WRadioButtonSelect.Layout getButtonLayout()
- Returns:
- the layout;
-
isFrameless
public boolean isFrameless()
- Returns:
- true if the frame should not be rendered.
-
setFrameless
public void setFrameless(boolean frameless)
- Parameters:
frameless
- if true, the frame will not be rendered.
-
isAjax
public boolean isAjax()
Indicates whether this component is AJAX enabled. A list is an AJAX list if it has atarget set
.- Overrides:
isAjax
in classAbstractWSelectList
- Returns:
- true if this list is AJAX enabled, false otherwise.
-
setAjaxTarget
public void setAjaxTarget(AjaxTarget ajaxTarget)
Sets the default AJAX target for this list. If a target is supplied, an AJAX request is made rather than a round-trip to the server. The AJAX response will only contain the (possibly updated) target element rather than the entire UI.- Overrides:
setAjaxTarget
in classAbstractWSelectList
- Parameters:
ajaxTarget
- the AJAX target.
-
getAjaxTarget
public AjaxTarget getAjaxTarget()
Retrieves the default AJAX target.- Overrides:
getAjaxTarget
in classAbstractWSelectList
- Returns:
- the default AJAX target for this list.
-
newComponentModel
protected WRadioButtonSelect.RadioButtonSelectModel newComponentModel()
Creates a new Component model.- Overrides:
newComponentModel
in classAbstractWSelectList
- Returns:
- a new RadioButtonSelectModel.
-
getComponentModel
protected WRadioButtonSelect.RadioButtonSelectModel getComponentModel()
Returns the effective component model for this component. Subclass may override this method to narrow the return type to their specific model type.- Overrides:
getComponentModel
in classAbstractWSelectList
- Returns:
- the effective component model
-
getOrCreateComponentModel
protected WRadioButtonSelect.RadioButtonSelectModel getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified. If this method is called during request processing, and a session specific model does not yet exist, then a new model is created. Subclasses may override this method to narrow the return type to their specific model type.- Overrides:
getOrCreateComponentModel
in classAbstractWSelectList
- Returns:
- the model for this component
-
-