org.primefaces.util
Class ComponentUtils
java.lang.Object
org.primefaces.util.ComponentUtils
public class ComponentUtils
- extends Object
Method Summary |
static boolean |
considerEmptyStringAsNull(javax.faces.context.FacesContext context)
|
static List<javax.faces.model.SelectItem> |
createSelectItems(javax.faces.component.UIComponent component)
|
static void |
decorateAttribute(javax.faces.component.UIComponent component,
String attribute,
String value)
|
static String |
escapeJQueryId(String id)
|
static String |
findClientIds(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String list)
|
static javax.faces.component.UIComponent |
findComponent(javax.faces.component.UIComponent base,
String id)
|
static String |
findComponentClientId(String id)
|
static javax.faces.component.UIComponent |
findParentForm(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
|
static javax.faces.component.UIComponent |
findParentNamingContainer(javax.faces.component.UIComponent component)
|
static javax.faces.component.UniqueIdVendor |
findParentUniqueIdVendor(javax.faces.component.UIComponent component)
|
static javax.faces.convert.Converter |
getConverter(javax.faces.context.FacesContext context,
javax.faces.component.ValueHolder component)
Finds appropriate converter for a given value holder |
static String |
getValueToRender(javax.faces.context.FacesContext context,
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 |
static String |
getWidgetVar(String id)
|
static boolean |
isBeansValidationAvailable(javax.faces.context.FacesContext context)
|
static boolean |
isLiteralText(javax.faces.component.UIComponent component)
|
static boolean |
isPartialSubmitEnabled(javax.faces.context.FacesContext context)
|
static boolean |
isRTL(javax.faces.context.FacesContext context,
RTLAware component)
|
static boolean |
isValueBlank(String value)
|
static Locale |
toLocale(String str)
Implementation from Apache Commons Lang |
static boolean |
validateEmptyFields(javax.faces.context.FacesContext context)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ComponentUtils
public ComponentUtils()
getValueToRender
public static String getValueToRender(javax.faces.context.FacesContext context,
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
- Parameters:
context
- FacesContext instancecomponent
- UIComponent instance whose value will be returned
- Returns:
- End text
getConverter
public static javax.faces.convert.Converter getConverter(javax.faces.context.FacesContext context,
javax.faces.component.ValueHolder component)
- Finds appropriate converter for a given value holder
- Parameters:
context
- FacesContext instancecomponent
- ValueHolder instance to look converter for
- Returns:
- Converter
findParentForm
public static javax.faces.component.UIComponent findParentForm(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
findParentUniqueIdVendor
public static javax.faces.component.UniqueIdVendor findParentUniqueIdVendor(javax.faces.component.UIComponent component)
findParentNamingContainer
public static javax.faces.component.UIComponent findParentNamingContainer(javax.faces.component.UIComponent component)
decorateAttribute
public static void decorateAttribute(javax.faces.component.UIComponent component,
String attribute,
String value)
createSelectItems
public static List<javax.faces.model.SelectItem> createSelectItems(javax.faces.component.UIComponent component)
escapeJQueryId
public static String escapeJQueryId(String id)
findClientIds
public static String findClientIds(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String list)
findComponentClientId
public static String findComponentClientId(String id)
findComponent
public static javax.faces.component.UIComponent findComponent(javax.faces.component.UIComponent base,
String id)
getWidgetVar
public static String getWidgetVar(String id)
isLiteralText
public static boolean isLiteralText(javax.faces.component.UIComponent component)
toLocale
public static Locale toLocale(String str)
- Implementation from Apache Commons Lang
validateEmptyFields
public static boolean validateEmptyFields(javax.faces.context.FacesContext context)
isBeansValidationAvailable
public static boolean isBeansValidationAvailable(javax.faces.context.FacesContext context)
isPartialSubmitEnabled
public static boolean isPartialSubmitEnabled(javax.faces.context.FacesContext context)
isValueBlank
public static boolean isValueBlank(String value)
isRTL
public static boolean isRTL(javax.faces.context.FacesContext context,
RTLAware component)
considerEmptyStringAsNull
public static boolean considerEmptyStringAsNull(javax.faces.context.FacesContext context)
Copyright © 2013. All Rights Reserved.