public class ComponentUtils
extends java.lang.Object
| Constructor and Description |
|---|
ComponentUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
enableOnElementUpdateNotify(javax.faces.context.ResponseWriter writer,
java.lang.String id) |
static java.lang.String |
encodeNameSpace(javax.faces.context.FacesContext fc,
java.lang.String id)
Environments like portlets need to namespace the components in order to uniquely identify them
on the page in case there are multiple instances of the same portlet or different portlets that use
the same ids.
|
static java.lang.String |
findClientIds(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.String list) |
static javax.faces.component.UIComponent |
findComponent(javax.faces.component.UIComponent base,
java.lang.String id) |
static java.util.List<java.lang.String> |
findIdsInView(javax.faces.context.FacesContext context)
used by GrowlMessagesRenderer and MessagesRenderer for option @inView
|
static java.util.List<java.lang.String> |
findInFacesContext(ButtonGroupMember button,
javax.faces.context.FacesContext fc)
This method will look in Context attributes for the buttonGroups registered in the view
|
static java.lang.String |
findInHeirarchy(ButtonGroupMember button,
javax.faces.context.FacesContext context)
A buttonGroup will put itself in the context while its children are rendering and
automatically the groupId will set itself.
|
static javax.faces.component.UIComponent |
findParentForm(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
static java.util.ResourceBundle |
getComponentResourceBundle(javax.faces.context.FacesContext context,
java.lang.String ACE_MESSAGES_BUNDLE)
Not all text for components are easy to make attributes for components,
especially those for accessibility.
|
static java.lang.String |
getFocusedElementId(javax.faces.component.UIComponent component) |
static java.lang.String |
getLocalisedMessageFromBundle(java.util.ResourceBundle bundle,
java.lang.String MESSAGE_KEY_PREFIX,
java.lang.String key,
java.lang.String defaultValue) |
static java.util.Iterator<javax.faces.application.FacesMessage> |
getMessagesInView(javax.faces.context.FacesContext context,
java.util.List<java.lang.String> idsInView)
used by GrowlMessagesRenderer and MessagesRenderer for option @inView
|
static java.lang.String |
getStringValueToRender(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
Algorithm works as follows;
- If it's an input component, submitted value is checked first since it'd be the value to be used in case validation errors
terminates jsf lifecycle
- Finally the value of the component is retrieved from backing bean and if there's a converter, converted value is returned
- If the component is not a value holder, toString of component is used to support Facelets UIInstructions.
|
static void |
renderPassThroughAttribute(javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String attribute)
Render pass-through attribute for the given component.
|
static void |
renderPassThroughAttribute(javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String attribute,
java.lang.String initialValue)
Render pass-through attribute for the given component.
|
static void |
renderPassThroughAttributes(javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String[] attrs)
Render pass-through attributes for the given component.
|
static java.lang.String |
resolveField(javax.el.ValueExpression expression)
Attempts to return the property accessed in a simple EL expression of the form
${someObject.property}.
|
public static java.lang.String getStringValueToRender(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
facesContext - FacesContext instancecomponent - UIComponent instance whose value will be returnedpublic static java.lang.String resolveField(javax.el.ValueExpression expression)
expression - An EL expression to parse the property from.public static javax.faces.component.UIComponent findParentForm(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
public static java.lang.String findClientIds(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.String list)
public static java.lang.String encodeNameSpace(javax.faces.context.FacesContext fc,
java.lang.String id)
fc - The current FacesContext instanceid - The id to encodepublic static javax.faces.component.UIComponent findComponent(javax.faces.component.UIComponent base,
java.lang.String id)
public static void enableOnElementUpdateNotify(javax.faces.context.ResponseWriter writer,
java.lang.String id)
throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<java.lang.String> findIdsInView(javax.faces.context.FacesContext context)
context - public static java.util.Iterator<javax.faces.application.FacesMessage> getMessagesInView(javax.faces.context.FacesContext context,
java.util.List<java.lang.String> idsInView)
context - idsInView - public static java.lang.String getFocusedElementId(javax.faces.component.UIComponent component)
public static java.lang.String findInHeirarchy(ButtonGroupMember button, javax.faces.context.FacesContext context)
button - context - public static java.util.List<java.lang.String> findInFacesContext(ButtonGroupMember button, javax.faces.context.FacesContext fc)
button - fc - public static void renderPassThroughAttributes(javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String[] attrs)
throws java.io.IOException
writer - component - attrs - java.io.IOExceptionpublic static void renderPassThroughAttribute(javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String attribute,
java.lang.String initialValue)
throws java.io.IOException
writer - component - attribute - initialValue - java.io.IOExceptionpublic static void renderPassThroughAttribute(javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String attribute)
throws java.io.IOException
writer - component - attribute - java.io.IOExceptionpublic static java.util.ResourceBundle getComponentResourceBundle(javax.faces.context.FacesContext context,
java.lang.String ACE_MESSAGES_BUNDLE)
public static java.lang.String getLocalisedMessageFromBundle(java.util.ResourceBundle bundle,
java.lang.String MESSAGE_KEY_PREFIX,
java.lang.String key,
java.lang.String defaultValue)
bundle - MESSAGE_KEY_PREFIX - key - defaultValue - Copyright 2017 ICEsoft Technologies Canada Corp., All Rights Reserved.