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

public Class ButtonRenderer

extends HtmlBasicRenderer
Class Inheritance
Static Imports
com.sun.faces.renderkit.RenderKitUtils.PredefinedPostbackParameter.BEHAVIOR_SOURCE_PARAM

ButtonRenderer is a class that renders the current value of UICommand as a Button.

Field Summary

Modifier and TypeField and Description
private static final Attribute[]
Inherited from com.sun.faces.renderkit.html_basic.HtmlBasicRenderer:
EMPTY_PARAMSlogger

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 javax.faces.render.Renderer.encodeBegin.

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

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

Render the ending of the current state of the specified UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered.

private static String

Returns:

the type for this button
getButtonType
(UIComponent
the component of interest
component
)

If the component's type attribute is null or not equal to reset, submit or button, default to submit.

private static Map<String, List<ClientBehavior>>
private static boolean

Returns:

true if the button represents a reset button, otherwise false
isReset
(UIComponent
the component of interest
component
)

private static boolean

Returns:

true if this component was in fact activated, otherwise false
wasClicked
(FacesContext
the FacesContext for the current request
context
,
UIComponent
the component of interest
component
,
String
the client id, if it has been retrieved, otherwise null
clientId
)

Determine if this component was activated on the client side.

Inherited from com.sun.faces.renderkit.html_basic.HtmlBasicRenderer:
augmentIdReferenceconvertClientIddecodeBehaviorsencodeRecursivegetBehaviorParametersgetChildrengetCurrentValuegetEndTextToRendergetFacetgetForComponentgetFormattedValuegetFormattedValuegetMessageItergetParamListgetPassThruBehaviorsgetRendersChildrengetValueisBehaviorSourcerendererParamsNotNullsetSubmittedValueshouldDecodeshouldEncodeshouldEncodeChildrenshouldWriteIdAttributewriteIdAttributeIfNecessary

Field Detail

ATTRIBUTESback to summary
private static final Attribute[] ATTRIBUTES

Constructor Detail

ButtonRendererback to summary
public ButtonRenderer()

Method Detail

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

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

Doc from javax.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 javax.faces.render.Renderer.encodeBegin.

Doc from javax.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
encodeEndback to summary
public void encodeEnd(FacesContext context, UIComponent component) throws IOException

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

Doc from javax.faces.render.Renderer.encodeEnd.

Render the ending of the current state of the specified UIComponent, following the rules described for encodeBegin() to acquire the appropriate value to be rendered.

Parameters
context:FacesContext

FacesContext for the response we are creating

component:UIComponent

UIComponent to be rendered

Annotations
@Override
Exceptions
IOException:
if an input/output error occurs while rendering
getButtonTypeback to summary
private static String getButtonType(UIComponent component)

If the component's type attribute is null or not equal to reset, submit or button, default to submit.

Parameters
component:UIComponent

the component of interest

Returns:String

the type for this button

getNonOnClickBehaviorsback to summary
private static Map<String, List<ClientBehavior>> getNonOnClickBehaviors(UIComponent component)
isResetback to summary
private static boolean isReset(UIComponent component)
Parameters
component:UIComponent

the component of interest

Returns:boolean

true if the button represents a reset button, otherwise false

wasClickedback to summary
private static boolean wasClicked(FacesContext context, UIComponent component, String clientId)

Determine if this component was activated on the client side.

Parameters
context:FacesContext

the FacesContext for the current request

component:UIComponent

the component of interest

clientId:String

the client id, if it has been retrieved, otherwise null

Returns:boolean

true if this component was in fact activated, otherwise false