com.sun.faces.renderkit
public class RenderKitUtils extends java.lang.Object
A set of utilities for use in RenderKit
s.
Modifier and Type | Class and Description |
---|---|
private static class |
RenderKitUtils.HandlerType |
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ATTRIBUTES_THAT_ARE_SET_KEY
IMPLEMENTATION NOTE: This must be kept in sync with the Key
in UIComponentBase$AttributesMap and HtmlComponentGenerator.
|
private static java.lang.String[] |
BOOLEAN_ATTRIBUTES
Boolean attributes to be rendered
using XHMTL semantics. |
private static java.lang.String |
CONTENT_TYPE_DELIMITER
The character that is used to delimit content types
in an accept String.
|
private static java.lang.String |
CONTENT_TYPE_SUBTYPE_DELIMITER
The character that is used to delimit the type and
subtype portions of a content type in an accept String.
|
protected static java.util.logging.Logger |
LOGGER |
private static int |
MAX_CONTENT_TYPE_PARTS
The maximum number of content type parts.
|
private static java.lang.String |
OPTIMIZED_PACKAGE
This represents the base package that can leverage the
attributesThatAreSet List for optimized attribute
rendering. |
private static java.lang.String |
XHTML_ATTR_PREFIX
The prefix to append to certain attributes when renderking
XHTML Transitional content. |
private static java.lang.String[] |
XHTML_PREFIX_ATTRIBUTES
An array of attributes that must be prefixed by
XHTML_ATTR_PREFIX when rendering
XHTML Transitional content. |
Modifier | Constructor and Description |
---|---|
private |
RenderKitUtils() |
Modifier and Type | Method and Description |
---|---|
private static boolean |
appendBehaviorsToChain(java.lang.StringBuilder builder,
javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.util.List<javax.faces.component.behavior.ClientBehavior> behaviors,
java.lang.String behaviorEventName,
java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params) |
static void |
appendProperty(java.lang.StringBuilder builder,
java.lang.String name,
java.lang.Object value) |
static void |
appendProperty(java.lang.StringBuilder builder,
java.lang.String name,
java.lang.Object value,
boolean quoteValue) |
private static void |
appendQuotedValue(java.lang.StringBuilder builder,
java.lang.String script) |
private static void |
appendScriptToChain(java.lang.StringBuilder builder,
java.lang.String script) |
private static java.lang.String[][] |
buildTypeArrayFromString(java.lang.String accept)
This method builds a two element array structure as follows:
Example:
Given the following accept string:
text/html; level=1, text/plain; q=0.5
[0][0] 1 (quality is 1 if none specified)
[0][1] "text" (type)
[0][2] "html; level=1" (subtype)
[0][3] 1 (level, if specified; null if not)
[1][0] .5
[1][1] "text"
[1][2] "plain"
[1][3] (level, if specified; null if not)
The array is used for comparison purposes in the findMatch method.
|
private static boolean |
canBeOptimized(javax.faces.component.UIComponent component,
java.util.Map<java.lang.String,java.util.List<javax.faces.component.behavior.ClientBehavior>> behaviors) |
private static javax.faces.component.behavior.ClientBehaviorContext |
createClientBehaviorContext(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.String behaviorEventName,
java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params) |
static java.lang.String |
createValidECMAIdentifier(java.lang.String origIdentifier)
Replaces all occurrences of
- with $_ . |
static java.lang.String |
determineContentType(java.lang.String accept,
java.lang.String serverSupportedTypes,
java.lang.String preferredType)
Given an accept String from the client, and a
String
of server supported content types, determine the best qualified
content type for the client. |
private static java.lang.String[][] |
findMatch(java.lang.String[][] clientContentTypes,
java.lang.String[][] serverSupportedContentTypes,
java.lang.String[][] preferredContentType)
For each server supported type, compare client (browser) specified types.
|
private static java.lang.String |
getChainedHandler(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.util.List<javax.faces.component.behavior.ClientBehavior> behaviors,
java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params,
java.lang.String behaviorEventName,
java.lang.String userHandler,
java.lang.String submitTarget,
boolean needsSubmit) |
private static java.util.List<javax.faces.component.behavior.ClientBehavior> |
getClientBehaviors(javax.faces.component.UIComponent component,
java.lang.String behaviorEventName) |
static javax.faces.render.RenderKit |
getCurrentRenderKit(javax.faces.context.FacesContext context)
Return the
RenderKit for the current request. |
static java.lang.String |
getFormClientId(javax.faces.component.UIComponent component,
javax.faces.context.FacesContext context)
Utility method to return the client ID of the parent form.
|
private static RenderKitUtils.HandlerType |
getHandlerType(java.util.List<javax.faces.component.behavior.ClientBehavior> behaviors,
java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params,
java.lang.String userHandler,
boolean needsSubmit,
boolean includeExec) |
static java.lang.String |
getImageSource(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.String attrName)
Determine the path value of an image value for a component such as
UIGraphic or UICommand.
|
private static java.lang.String |
getNonEmptyUserHandler(java.lang.Object handlerObject) |
static javax.faces.render.ResponseStateManager |
getResponseStateManager(javax.faces.context.FacesContext context,
java.lang.String renderKitId)
Obtain and return the
ResponseStateManager for
the specified #renderKitId. |
static java.util.Iterator<javax.faces.model.SelectItem> |
getSelectItems(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Return a List of
SelectItem
instances representing the available options for this component,
assembled from the set of UISelectItem
and/or UISelectItems components that are
direct children of this component. |
private static java.lang.String |
getSingleBehaviorEventName(java.util.Map<java.lang.String,java.util.List<javax.faces.component.behavior.ClientBehavior>> behaviors) |
private static java.lang.String |
getSingleBehaviorHandler(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
javax.faces.component.behavior.ClientBehavior behavior,
java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params,
java.lang.String behaviorEventName,
java.lang.String submitTarget,
boolean needsSubmit) |
private static java.lang.String |
getSubmitHandler(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params,
java.lang.String submitTarget,
boolean preventDefault) |
static boolean |
hasResourceBeenInstalled(javax.faces.context.FacesContext ctx,
java.lang.String name,
java.lang.String library) |
static boolean |
hasScriptBeenRendered(javax.faces.context.FacesContext context) |
private static boolean |
isBehaviorEventAttribute(Attribute attr,
java.lang.String behaviorEventName) |
private static boolean |
isExcludedAttribute(java.lang.String attributeName,
java.util.List excludedAttributes)
This method expects a
List of attribute names that are to
be excluded from rendering. |
static boolean |
isPartialOrBehaviorAction(javax.faces.context.FacesContext context,
java.lang.String clientId) |
private static boolean |
isSubmitting(javax.faces.component.behavior.ClientBehavior behavior) |
static boolean |
isXml(java.lang.String contentType) |
static java.lang.String |
prefixAttribute(java.lang.String attrName,
boolean isXhtml) |
static java.lang.String |
prefixAttribute(java.lang.String attrName,
javax.faces.context.ResponseWriter writer) |
private static void |
renderHandler(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params,
java.lang.String handlerName,
java.lang.Object handlerValue,
java.lang.String behaviorEventName,
java.lang.String submitTarget,
boolean needsSubmit,
boolean includeExec)
Renders a handler script, which may require chaining together
the user-specified event handler, any scripts required by attached
Behaviors, and also possibly the mojarra.jsfcljs() "submit" script.
|
static void |
renderHtmlErrorPage(javax.faces.context.FacesContext ctx,
javax.faces.FacesException fe) |
static void |
renderJsfJs(javax.faces.context.FacesContext context)
Renders the Javascript necessary to add and remove request
parameters to the current form.
|
static void |
renderOnchange(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
boolean incExec) |
static void |
renderOnclick(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params,
java.lang.String submitTarget,
boolean needsSubmit) |
static void |
renderPassThruAttributes(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
Attribute[] attributes)
Render any "passthru" attributes, where we simply just output the
raw name and value of the attribute.
|
static void |
renderPassThruAttributes(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
Attribute[] attributes,
java.util.Map<java.lang.String,java.util.List<javax.faces.component.behavior.ClientBehavior>> behaviors)
Render any "passthru" attributes, where we simply just output the
raw name and value of the attribute.
|
private static void |
renderPassThruAttributesOptimized(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
Attribute[] knownAttributes,
java.util.List<java.lang.String> setAttributes,
java.util.Map<java.lang.String,java.util.List<javax.faces.component.behavior.ClientBehavior>> behaviors)
For each attribute in
setAttributes , perform a binary
search against the array of knownAttributes If a match is found
and the value is not null , render the attribute. |
private static void |
renderPassThruAttributesUnoptimized(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
Attribute[] knownAttributes,
java.util.Map<java.lang.String,java.util.List<javax.faces.component.behavior.ClientBehavior>> behaviors)
Loops over all known attributes and attempts to render each one.
|
static void |
renderSelectOnclick(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
boolean incExec) |
static void |
renderUnhandledMessages(javax.faces.context.FacesContext ctx) |
static void |
renderXHTMLStyleBooleanAttributes(javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component)
Renders the attributes from
BOOLEAN_ATTRIBUTES
using XHMTL semantics (i.e., disabled="disabled"). |
static void |
renderXHTMLStyleBooleanAttributes(javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.util.List excludedAttributes)
Renders the attributes from
BOOLEAN_ATTRIBUTES
using XHMTL semantics (i.e., disabled="disabled"). |
static void |
setScriptAsRendered(javax.faces.context.FacesContext context)
Set a flag to indicate that the
add/remove javascript
has been rendered for the current form. |
private static boolean |
shouldRenderAttribute(java.lang.Object attributeVal)
Determines if an attribute should be rendered based on the
specified #attributeVal.
|
private static final java.lang.String XHTML_ATTR_PREFIX
The prefix to append to certain attributes when renderking
XHTML Transitional
content.
private static final java.lang.String[] BOOLEAN_ATTRIBUTES
Boolean
attributes to be rendered
using XHMTL
semantics.
private static final java.lang.String[] XHTML_PREFIX_ATTRIBUTES
An array of attributes that must be prefixed by
XHTML_ATTR_PREFIX
when rendering
XHTML Transitional
content.
private static final int MAX_CONTENT_TYPE_PARTS
The maximum number of content type parts. For example: for the type: "text/html; level=1; q=0.5" The parts of this type would be: "text" - type "html; level=1" - subtype "0.5" - quality value "1" - level value
private static final java.lang.String CONTENT_TYPE_DELIMITER
private static final java.lang.String CONTENT_TYPE_SUBTYPE_DELIMITER
private static final java.lang.String OPTIMIZED_PACKAGE
attributesThatAreSet
List for optimized attribute
rendering.
IMPLEMENTATION NOTE: This must be kept in sync with the array
in UIComponentBase$AttributesMap and HtmlComponentGenerator.
Hopefully JSF 2.0 will remove the need for this.private static final java.lang.String ATTRIBUTES_THAT_ARE_SET_KEY
protected static final java.util.logging.Logger LOGGER
public static javax.faces.render.RenderKit getCurrentRenderKit(javax.faces.context.FacesContext context)
Return the RenderKit
for the current request.
context
- the FacesContext
of the current requestRenderKit
for the current request.public static javax.faces.render.ResponseStateManager getResponseStateManager(javax.faces.context.FacesContext context, java.lang.String renderKitId) throws javax.faces.FacesException
Obtain and return the ResponseStateManager
for
the specified #renderKitId.
context
- the FacesContext
of the current requestrenderKitId
- RenderKit
IDResponseStateManager
for the specified
#renderKitIdjavax.faces.FacesException
- if an exception occurs while trying
to obtain the ResponseStateManager
public static java.util.Iterator<javax.faces.model.SelectItem> getSelectItems(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
Return a List of SelectItem
instances representing the available options for this component,
assembled from the set of UISelectItem
and/or UISelectItems
components that are
direct children of this component. If there are no such children, an
empty Iterator
is returned.
context
- The FacesContext
for the current request.
If null, the UISelectItems behavior will not work.component
- the componentjava.lang.IllegalArgumentException
- if context
is null
public static void renderPassThruAttributes(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, Attribute[] attributes) throws java.io.IOException
Render any "passthru" attributes, where we simply just output the raw name and value of the attribute. This method is aware of the set of HTML4 attributes that fall into this bucket. Examples are all the javascript attributes, alt, rows, cols, etc.
context
- the FacesContext for this requestwriter
- writer the ResponseWriter
to be used when writing
the attributescomponent
- the componentattributes
- an array of attributes to be processedjava.io.IOException
- if an error occurs writing the attributespublic static void renderPassThruAttributes(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, Attribute[] attributes, java.util.Map<java.lang.String,java.util.List<javax.faces.component.behavior.ClientBehavior>> behaviors) throws java.io.IOException
Render any "passthru" attributes, where we simply just output the raw name and value of the attribute. This method is aware of the set of HTML4 attributes that fall into this bucket. Examples are all the javascript attributes, alt, rows, cols, etc.
context
- the FacesContext for this requestwriter
- writer the ResponseWriter
to be used when writing
the attributescomponent
- the componentattributes
- an array of attributes to be processedbehaviors
- the behaviors for this component, or null if
component is not a ClientBehaviorHolderjava.io.IOException
- if an error occurs writing the attributespublic static void renderOnchange(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, boolean incExec) throws java.io.IOException
java.io.IOException
public static void renderSelectOnclick(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, boolean incExec) throws java.io.IOException
java.io.IOException
public static void renderOnclick(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params, java.lang.String submitTarget, boolean needsSubmit) throws java.io.IOException
java.io.IOException
public static java.lang.String prefixAttribute(java.lang.String attrName, javax.faces.context.ResponseWriter writer)
public static java.lang.String prefixAttribute(java.lang.String attrName, boolean isXhtml)
public static void renderXHTMLStyleBooleanAttributes(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component) throws java.io.IOException
Renders the attributes from BOOLEAN_ATTRIBUTES
using XHMTL
semantics (i.e., disabled="disabled").
writer
- writer the ResponseWriter
to be used when writing
the attributescomponent
- the componentjava.io.IOException
- if an error occurs writing the attributespublic static void renderXHTMLStyleBooleanAttributes(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.util.List excludedAttributes) throws java.io.IOException
Renders the attributes from BOOLEAN_ATTRIBUTES
using XHMTL
semantics (i.e., disabled="disabled").
writer
- writer the ResponseWriter
to be used when writing
the attributescomponent
- the componentexcludedAttributes
- a List
of attributes that are to be excluded from renderingjava.io.IOException
- if an error occurs writing the attributespublic static java.lang.String determineContentType(java.lang.String accept, java.lang.String serverSupportedTypes, java.lang.String preferredType)
Given an accept String from the client, and a String
of server supported content types, determine the best qualified
content type for the client. If no match is found, or either of the
arguments are null
, null
is returned.
accept
- The client accept StringserverSupportedTypes
- The types that the server supportspreferredType
- The preferred content type if another type is found
with the same highest quality factor.String
public static boolean isXml(java.lang.String contentType)
contentType
- the content type in questiontrue
if the content type is a known XML-based
content type, otherwise, false
private static boolean canBeOptimized(javax.faces.component.UIComponent component, java.util.Map<java.lang.String,java.util.List<javax.faces.component.behavior.ClientBehavior>> behaviors)
component
- the UIComponent in questiontrue
if the component is within the
javax.faces.component
or javax.faces.component.html
packages, otherwise return false
private static void renderPassThruAttributesOptimized(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, Attribute[] knownAttributes, java.util.List<java.lang.String> setAttributes, java.util.Map<java.lang.String,java.util.List<javax.faces.component.behavior.ClientBehavior>> behaviors) throws java.io.IOException
For each attribute in setAttributes
, perform a binary
search against the array of knownAttributes
If a match is found
and the value is not null
, render the attribute.
context
- the FacesContext
of the current requestwriter
- the current writercomponent
- the component whose attributes we're renderingknownAttributes
- an array of pass-through attributes supported by
this componentsetAttributes
- a List
of attributes that have been set
on the provided componentbehaviors
- the non-null behaviors map for this request.java.io.IOException
- if an error occurs during the writeprivate static void renderPassThruAttributesUnoptimized(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, Attribute[] knownAttributes, java.util.Map<java.lang.String,java.util.List<javax.faces.component.behavior.ClientBehavior>> behaviors) throws java.io.IOException
Loops over all known attributes and attempts to render each one.
context
- the FacesContext
of the current requestwriter
- the current writercomponent
- the component whose attributes we're renderingknownAttributes
- an array of pass-through attributes supported by
this componentbehaviors
- the non-null behaviors map for this request.java.io.IOException
- if an error occurs during the writeprivate static boolean shouldRenderAttribute(java.lang.Object attributeVal)
Determines if an attribute should be rendered based on the specified #attributeVal.
attributeVal
- the attribute valuetrue
if and only if #attributeVal is
an instance of a wrapper for a primitive type and its value is
equal to the default value for that type as given in the specification.private static boolean isExcludedAttribute(java.lang.String attributeName, java.util.List excludedAttributes)
This method expects a List
of attribute names that are to
be excluded from rendering. A Renderer
may include an attribute name in this
list for exclusion. For example, h:link
may use the disabled
attribute with a value of true
. However we don't want disabled
passed through and rendered on the span
element as it is invalid HTML.
attributeName
- the attribute name that is to be tested for exclusionexcludedAttributes
- the list of attribute names that are to be excluded from renderingtrue
if the attribute name is not in the exclude list.private static java.lang.String[][] buildTypeArrayFromString(java.lang.String accept)
This method builds a two element array structure as follows: Example: Given the following accept string: text/html; level=1, text/plain; q=0.5 [0][0] 1 (quality is 1 if none specified) [0][1] "text" (type) [0][2] "html; level=1" (subtype) [0][3] 1 (level, if specified; null if not) [1][0] .5 [1][1] "text" [1][2] "plain" [1][3] (level, if specified; null if not) The array is used for comparison purposes in the findMatch method.
accept
- An accept String
private static java.lang.String[][] findMatch(java.lang.String[][] clientContentTypes, java.lang.String[][] serverSupportedContentTypes, java.lang.String[][] preferredContentType)
For each server supported type, compare client (browser) specified types. If a match is found, keep track of the highest quality factor. The end result is that for all matches, only the one with the highest quality will be returned.
clientContentTypes
- An array
of accept String
information for the client built from @{link #buildTypeArrayFromString}.serverSupportedContentTypes
- An array
of accept String
information for the server supported types built from @{link #buildTypeArrayFromString}.preferredContentType
- An array
of preferred content type information.array
containing the parts of the preferred content type for the
client. The information is stored as outlined in @{link #buildTypeArrayFromString}.public static java.lang.String createValidECMAIdentifier(java.lang.String origIdentifier)
Replaces all occurrences of -
with $_
.
origIdentifier
- the original identifer that needs to be
'ECMA-ized'public static void renderJsfJs(javax.faces.context.FacesContext context) throws java.io.IOException
Renders the Javascript necessary to add and remove request parameters to the current form.
context
- the FacesContext
for the current requestjava.io.IOException
- if an error occurs writing to the responsepublic static boolean hasResourceBeenInstalled(javax.faces.context.FacesContext ctx, java.lang.String name, java.lang.String library)
public static void renderUnhandledMessages(javax.faces.context.FacesContext ctx)
public static void renderHtmlErrorPage(javax.faces.context.FacesContext ctx, javax.faces.FacesException fe)
public static boolean isPartialOrBehaviorAction(javax.faces.context.FacesContext context, java.lang.String clientId)
public static java.lang.String getFormClientId(javax.faces.component.UIComponent component, javax.faces.context.FacesContext context)
Utility method to return the client ID of the parent form.
component
- typically a command componentcontext
- the FacesContext
for the current requestpublic static boolean hasScriptBeenRendered(javax.faces.context.FacesContext context)
context
- the FacesContext
for the current requesttrue
If the add/remove
javascript
has been rendered, otherwise false
public static void setScriptAsRendered(javax.faces.context.FacesContext context)
Set a flag to indicate that the add/remove
javascript
has been rendered for the current form.
context
- the FacesContext
of the current requestpublic static java.lang.String getImageSource(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String attrName)
Determine the path value of an image value for a component such as UIGraphic or UICommand.
context
- the FacesContext
for the current request.component
- the component to obtain the image information fromattrName
- the attribute name that needs to be queried if the
name and library attributes are not specifiedprivate static void appendScriptToChain(java.lang.StringBuilder builder, java.lang.String script)
public static void appendProperty(java.lang.StringBuilder builder, java.lang.String name, java.lang.Object value)
public static void appendProperty(java.lang.StringBuilder builder, java.lang.String name, java.lang.Object value, boolean quoteValue)
private static void appendQuotedValue(java.lang.StringBuilder builder, java.lang.String script)
private static boolean appendBehaviorsToChain(java.lang.StringBuilder builder, javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.util.List<javax.faces.component.behavior.ClientBehavior> behaviors, java.lang.String behaviorEventName, java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params)
private static java.lang.String getSingleBehaviorEventName(java.util.Map<java.lang.String,java.util.List<javax.faces.component.behavior.ClientBehavior>> behaviors)
private static boolean isBehaviorEventAttribute(Attribute attr, java.lang.String behaviorEventName)
private static java.lang.String getNonEmptyUserHandler(java.lang.Object handlerObject)
private static java.util.List<javax.faces.component.behavior.ClientBehavior> getClientBehaviors(javax.faces.component.UIComponent component, java.lang.String behaviorEventName)
private static java.lang.String getSubmitHandler(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params, java.lang.String submitTarget, boolean preventDefault)
private static java.lang.String getChainedHandler(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.util.List<javax.faces.component.behavior.ClientBehavior> behaviors, java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params, java.lang.String behaviorEventName, java.lang.String userHandler, java.lang.String submitTarget, boolean needsSubmit)
private static java.lang.String getSingleBehaviorHandler(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, javax.faces.component.behavior.ClientBehavior behavior, java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params, java.lang.String behaviorEventName, java.lang.String submitTarget, boolean needsSubmit)
private static javax.faces.component.behavior.ClientBehaviorContext createClientBehaviorContext(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String behaviorEventName, java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params)
private static boolean isSubmitting(javax.faces.component.behavior.ClientBehavior behavior)
private static void renderHandler(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params, java.lang.String handlerName, java.lang.Object handlerValue, java.lang.String behaviorEventName, java.lang.String submitTarget, boolean needsSubmit, boolean includeExec) throws java.io.IOException
context
- the FacesContext for this request.component
- the UIComponent that we are renderingparams
- any parameters that should be included by "submitting"
scripts.handlerName
- the name of the handler attribute to render (eg.
"onclick" or "ommouseover")handlerValue
- the user-specified value for the handler attributebehaviorEventName
- the name of the behavior event that corresponds
to this handler (eg. "action" or "mouseover").needsSubmit
- indicates whether the mojarra.jsfcljs()
"submit" script is required by the component. Most components
do not need this, either because they submit themselves
(eg. commandButton), or because they do not perform submits
(eg. non-command components). This flag is mainly here for
the commandLink case, where we need to render the submit
script to make the link submit.java.io.IOException
private static RenderKitUtils.HandlerType getHandlerType(java.util.List<javax.faces.component.behavior.ClientBehavior> behaviors, java.util.Collection<javax.faces.component.behavior.ClientBehaviorContext.Parameter> params, java.lang.String userHandler, boolean needsSubmit, boolean includeExec)
Copyright © 2002-2010 Oracle America, Inc. All Rights Reserved.