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

public Class CheckboxRenderer

extends HtmlBasicInputRenderer
Class Inheritance
Imports
java.io.IOException, java.util.Map, java.util.logging.Level, com.sun.faces.renderkit.Attribute, .AttributeManager, .RenderKitUtils, jakarta.faces.component.UIComponent, jakarta.faces.context.FacesContext, .ResponseWriter, jakarta.faces.convert.ConverterException

CheckboxRenderer is a class that renders the current value of UISelectBoolean as a checkbox.

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.HtmlBasicRenderer.decode.

Decode any new state of the specified UIComponent from the request contained in the specified FacesContext, and store that state on the UIComponent.

public void
encodeBegin(FacesContext
FacesContext for the request we are processing
context
,
UIComponent
UIComponent to be rendered
component
)

Overrides jakarta.faces.render.Renderer.encodeBegin.

Render the beginning specified UIComponent to the output stream or writer associated with the response we are creating.

public Object
getConvertedValue(FacesContext
FacesContext for the request we are processing
context
,
UIComponent
UIComponent to be decoded.
component
,
Object
a value stored on the component during decode.
submittedValue
)

Overrides com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue.

Attempt to convert previously stored state information into an object of the type required for this component (optionally using the registered jakarta.faces.convert.Converter for this component, if there is one).

protected void
getEndTextToRender(FacesContext
the FacesContext for the current request
context
,
UIComponent
the UIComponent of interest
component
,
String
component's current value
currentValue
)

Overrides com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getEndTextToRender.

Renderers override this method to write appropriate HTML content into the buffer.

private static boolean

Returns:

"true" if the component was checked, otherise "false"
isChecked
(String
the submitted value
value
)

Inherited from com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer:
getNonOnChangeBehaviorsgetNonOnClickSelectBehaviorsgetValuesetSubmittedValue

Field Detail

ATTRIBUTESback to summary
private static final Attribute[] ATTRIBUTES

Constructor Detail

CheckboxRendererback to summary
public CheckboxRenderer()

Method Detail

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

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

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

Decode any new state of the specified UIComponent from the request contained in the specified FacesContext, and store that state on the UIComponent.

During decoding, events may be enqueued for later processing (by event listeners that have registered an interest), by calling queueEvent() on the associated UIComponent.

Parameters
context:FacesContext

FacesContext for the request we are processing

component:UIComponent

UIComponent to be decoded.

Annotations
@Override
encodeBeginback to summary
public void encodeBegin(FacesContext context, UIComponent component) throws IOException

Overrides jakarta.faces.render.Renderer.encodeBegin.

Doc from jakarta.faces.render.Renderer.encodeBegin.

Render the beginning specified UIComponent to the output stream or writer associated with the response we are creating. If the conversion attempted in a previous call to getConvertedValue() for this component failed, the state information saved during execution of decode() should be used to reproduce the incorrect input.

Parameters
context:FacesContext

FacesContext for the request we are processing

component:UIComponent

UIComponent to be rendered

Annotations
@Override
Exceptions
IOException:
if an input/output error occurs while rendering
getConvertedValueback to summary
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException

Overrides com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue.

Doc from jakarta.faces.render.Renderer.getConvertedValue.

Attempt to convert previously stored state information into an object of the type required for this component (optionally using the registered jakarta.faces.convert.Converter for this component, if there is one). If conversion is successful, the new value should be returned from this method; if not, a ConverterException should be thrown.

Parameters
context:FacesContext

FacesContext for the request we are processing

component:UIComponent

UIComponent to be decoded.

submittedValue:Object

a value stored on the component during decode.

Returns:Object

the converted value

Annotations
@Override
Exceptions
ConverterException:
if the submitted value cannot be converted successfully.
getEndTextToRenderback to summary
protected void getEndTextToRender(FacesContext context, UIComponent component, String currentValue) throws IOException

Overrides com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getEndTextToRender.

Doc from com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getEndTextToRender.

Renderers override this method to write appropriate HTML content into the buffer.

Parameters
context:FacesContext

the FacesContext for the current request

component:UIComponent

the UIComponent of interest

currentValue:String

component's current value

Annotations
@Override
Exceptions
IOException:
if an error occurs rendering the text
isCheckedback to summary
private static boolean isChecked(String value)
Parameters
value:String

the submitted value

Returns:boolean

"true" if the component was checked, otherise "false"