Top Description Inners Fields Constructors Methods
com.sun.faces.renderkit.html_basic

public Class RadioRenderer

extends SelectManyCheckboxListRenderer
implements ComponentSystemEventListener
Class Inheritance
All Implemented Interfaces
jakarta.faces.event.ComponentSystemEventListener, jakarta.faces.event.FacesListener, java.util.EventListener
Annotations
@ListenerFor
systemEventClass:PostAddToViewEvent
Static Imports
java.lang.Boolean.TRUE

ReadoRenderer is a class that renders the current value of UISelectOne or UISelectMany component as a list of radio buttons

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
RadioRenderer.Group

Keeps track of all <h:selectOneRadio group> detail.

public static class
RadioRenderer.GroupSelectItem

Used when a <h:selectOneRadio group> doesn't have a select item; it will then get it via first radio of the group.

Field Summary

Modifier and TypeField and Description
private static final Attribute[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
decode(FacesContext
FacesContext for the request we are processing
context
,
UIComponent
UIComponent to be decoded.
component
)

Overrides com.sun.faces.renderkit.html_basic.MenuRenderer.decode.

This override delegates to decodeGroup(FacesContext context, UISelectOne radio, Group group) when 'group' attribute is set.

protected void
decodeGroup(FacesContext context, UISelectOne radio, RadioRenderer.Group group)

The difference with default decoding is:

  • Submitted value is obtained by group name.
  • Submitted value is prefixed with client ID of radio button component, this need to be compared and trimmed.
  • If any submitted value does not belong to current radio button component, reset its value.
public void
encodeEnd(FacesContext
FacesContext for the response we are creating
context
,
UIComponent
UIComponent to be rendered
component
)

Overrides com.sun.faces.renderkit.html_basic.SelectManyCheckboxListRenderer.encodeEnd.

This override delegates to encodeEndGroup(FacesContext context, UISelectOne radio, Group group) when 'group' attribute is set.

protected void
encodeEndGroup(FacesContext context, UISelectOne radio, RadioRenderer.Group group)

The difference with default encoding is:

  1. Every radio button of same 'group' will have same 'name' attribute rendered, relative to UIForm parent.
  2. The 'value' attribute of every radio button is prefixed with client ID of radio button component itself.
  3. No additional (table) markup is being rendered.
  4. Label, if any, is rendered directly after radio button element, without additional markup.
protected static RadioRenderer.Group
protected boolean
isChecked(FacesContext context, UISelectOne radio, Object itemValue)

public void
processEvent(ComponentSystemEvent
the ComponentSystemEvent instance that is being processed.
event
)

Implements jakarta.faces.event.ComponentSystemEventListener.processEvent.

After adding component to view, if component has group attribute set, then pre-collect the components by group.

protected void
renderInput(FacesContext context, ResponseWriter writer, UIComponent component, String clientId, Object itemValue, Converter<?> converter, boolean checked, boolean disabled, RadioRenderer.Group group)

protected void
renderLabel(ResponseWriter writer, UIComponent component, String forClientId, SelectItem curItem, HtmlBasicRenderer.OptionComponentInfo optionInfo)

protected void
renderOption(FacesContext context, UIComponent component, Converter<T> converter, SelectItem curItem, Object currentSelections, Object[] submittedValues, Boolean newTableRow, int itemNumber, HtmlBasicRenderer.OptionComponentInfo optionInfo)

Overrides com.sun.faces.renderkit.html_basic.SelectManyCheckboxListRenderer.renderOption.

Inherited from com.sun.faces.renderkit.html_basic.SelectManyCheckboxListRenderer:
getSelectedTextStringisBehaviorSourcerenderBeginTextrenderEndText

Field Detail

ATTRIBUTESback to summary
private static final Attribute[] ATTRIBUTES

Hides com.sun.faces.renderkit.html_basic.SelectManyCheckboxListRenderer.ATTRIBUTES.

Constructor Detail

RadioRendererback to summary
public RadioRenderer()

Method Detail

decodeback to summary
public void decode(FacesContext context, UIComponent component)

Overrides com.sun.faces.renderkit.html_basic.MenuRenderer.decode.

This override delegates to decodeGroup(FacesContext context, UISelectOne radio, Group group) when 'group' attribute is set. It will only decode when the current component is the first one of group.

Parameters
context:FacesContext

Doc from jakarta.faces.render.Renderer.decode.

FacesContext for the request we are processing

component:UIComponent

Doc from jakarta.faces.render.Renderer.decode.

UIComponent to be decoded.

Annotations
@Override
decodeGroupback to summary
protected void decodeGroup(FacesContext context, UISelectOne radio, RadioRenderer.Group group)

The difference with default decoding is:

  • Submitted value is obtained by group name.
  • Submitted value is prefixed with client ID of radio button component, this need to be compared and trimmed.
  • If any submitted value does not belong to current radio button component, reset its value.
encodeEndback to summary
public void encodeEnd(FacesContext context, UIComponent component) throws IOException

Overrides com.sun.faces.renderkit.html_basic.SelectManyCheckboxListRenderer.encodeEnd.

This override delegates to encodeEndGroup(FacesContext context, UISelectOne radio, Group group) when 'group' attribute is set.

Parameters
context:FacesContext

Doc from jakarta.faces.render.Renderer.encodeEnd.

FacesContext for the response we are creating

component:UIComponent

Doc from jakarta.faces.render.Renderer.encodeEnd.

UIComponent to be rendered

Annotations
@Override
Exceptions
IOException:

Doc from jakarta.faces.render.Renderer.encodeEnd.

if an input/output error occurs while rendering

encodeEndGroupback to summary
protected void encodeEndGroup(FacesContext context, UISelectOne radio, RadioRenderer.Group group) throws IOException

The difference with default encoding is:

  1. Every radio button of same 'group' will have same 'name' attribute rendered, relative to UIForm parent.
  2. The 'value' attribute of every radio button is prefixed with client ID of radio button component itself.
  3. No additional (table) markup is being rendered.
  4. Label, if any, is rendered directly after radio button element, without additional markup.
getGroupback to summary
protected static RadioRenderer.Group getGroup(FacesContext context, UISelectOne radio)
isCheckedback to summary
protected boolean isChecked(FacesContext context, UISelectOne radio, Object itemValue)
processEventback to summary
public void processEvent(ComponentSystemEvent event) throws AbortProcessingException

Implements jakarta.faces.event.ComponentSystemEventListener.processEvent.

After adding component to view, if component has group attribute set, then pre-collect the components by group.

Parameters
event:ComponentSystemEvent

Doc from jakarta.faces.event.ComponentSystemEventListener.processEvent.

the ComponentSystemEvent instance that is being processed.

Annotations
@Override
Exceptions
AbortProcessingException:

Doc from jakarta.faces.event.ComponentSystemEventListener.processEvent.

if lifecycle processing should cease for this request.

renderInputback to summary
protected void renderInput(FacesContext context, ResponseWriter writer, UIComponent component, String clientId, Object itemValue, Converter<?> converter, boolean checked, boolean disabled, RadioRenderer.Group group) throws IOException
renderLabelback to summary
protected void renderLabel(ResponseWriter writer, UIComponent component, String forClientId, SelectItem curItem, HtmlBasicRenderer.OptionComponentInfo optionInfo) throws IOException
renderOptionback to summary
protected void renderOption(FacesContext context, UIComponent component, Converter<T> converter, SelectItem curItem, Object currentSelections, Object[] submittedValues, Boolean newTableRow, int itemNumber, HtmlBasicRenderer.OptionComponentInfo optionInfo) throws IOException

Overrides com.sun.faces.renderkit.html_basic.SelectManyCheckboxListRenderer.renderOption.

Annotations
@Override
com.sun.faces.renderkit.html_basic back to summary

protected Class RadioRenderer.Group

extends Object
Class Inheritance

Keeps track of all <h:selectOneRadio group> detail.

Field Summary

Modifier and TypeField and Description
private final List<String>
private final String
private ValueExpression

Constructor Summary

AccessConstructor and Description
public
Group(FacesContext context, String clientName)

Method Summary

Modifier and TypeMethod and Description
public void
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clientIdsback to summary
private final List<String> clientIds
clientNameback to summary
private final String clientName
valueback to summary
private ValueExpression value

Constructor Detail

Groupback to summary
public Group(FacesContext context, String clientName)

Method Detail

addRadioback to summary
public void addRadio(FacesContext context, UISelectOne radio)
getClientNameback to summary
public String getClientName()
com.sun.faces.renderkit.html_basic back to summary

public Class RadioRenderer.GroupSelectItem

extends UISelectItem
Class Inheritance

Used when a <h:selectOneRadio group> doesn't have a select item; it will then get it via first radio of the group.

Field Summary

Modifier and TypeField and Description
private SelectItem
Inherited from jakarta.faces.component.UISelectItem:
COMPONENT_FAMILYCOMPONENT_TYPE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getItemDescription()

Overrides jakarta.faces.component.UISelectItem.getItemDescription.

Return the description for this selection item.

public String
getItemLabel()

Overrides jakarta.faces.component.UISelectItem.getItemLabel.

Return the localized label for this selection item.

public Object
getItemValue()

Overrides jakarta.faces.component.UISelectItem.getItemValue.

Return the server value for this selection item.

private SelectItem
public boolean
isItemDisabled()

Overrides jakarta.faces.component.UISelectItem.isItemDisabled.

Return the disabled setting for this selection item.

public boolean
isItemEscaped()

Overrides jakarta.faces.component.UISelectItem.isItemEscaped.

Return the escape setting for the label of this selection item.

public boolean
isNoSelectionOption()

Overrides jakarta.faces.component.UISelectItem.isNoSelectionOption.

Return the value of the noSelectionOption property.

Inherited from jakarta.faces.component.UISelectItem:
getFamilygetValuesetItemDescriptionsetItemDisabledsetItemEscapedsetItemLabelsetItemValuesetNoSelectionOptionsetValue

Field Detail

selectItemback to summary
private SelectItem selectItem

Constructor Detail

GroupSelectItemback to summary
public GroupSelectItem()

Method Detail

getItemDescriptionback to summary
public String getItemDescription()

Overrides jakarta.faces.component.UISelectItem.getItemDescription.

Doc from jakarta.faces.component.UISelectItem.getItemDescription.

Return the description for this selection item.

Returns:String

the item description.

Annotations
@Override
getItemLabelback to summary
public String getItemLabel()

Overrides jakarta.faces.component.UISelectItem.getItemLabel.

Doc from jakarta.faces.component.UISelectItem.getItemLabel.

Return the localized label for this selection item.

Returns:String

the item label.

Annotations
@Override
getItemValueback to summary
public Object getItemValue()

Overrides jakarta.faces.component.UISelectItem.getItemValue.

Doc from jakarta.faces.component.UISelectItem.getItemValue.

Return the server value for this selection item.

Returns:Object

the item value.

Annotations
@Override
getSelectItemback to summary
private SelectItem getSelectItem()
Annotations
@SuppressWarnings:unchecked
isItemDisabledback to summary
public boolean isItemDisabled()

Overrides jakarta.faces.component.UISelectItem.isItemDisabled.

Doc from jakarta.faces.component.UISelectItem.isItemDisabled.

Return the disabled setting for this selection item.

Returns:boolean

true is the item disabled, false otherwise.

Annotations
@Override
isItemEscapedback to summary
public boolean isItemEscaped()

Overrides jakarta.faces.component.UISelectItem.isItemEscaped.

Doc from jakarta.faces.component.UISelectItem.isItemEscaped.

Return the escape setting for the label of this selection item.

Returns:boolean

true if the item is escaped, false otherwise.

Annotations
@Override
isNoSelectionOptionback to summary
public boolean isNoSelectionOption()

Overrides jakarta.faces.component.UISelectItem.isNoSelectionOption.

Doc from jakarta.faces.component.UISelectItem.isNoSelectionOption.

Return the value of the noSelectionOption property. If the value of this property is true, the system interprets the option represented by this UISelectItem instance as representing a "no selection" option. See UISelectOne#validateValue and UISelectMany#validateValue for usage.

Returns:boolean

the no selection option.

Annotations
@Override