public final class JSFUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
buildImageTag(javax.faces.context.FacesContext context,
String image,
int width,
int height,
String alt)
Build a context path safe image tag for the supplied image path.
|
static String |
buildImageTag(javax.faces.context.FacesContext context,
String image,
int width,
int height,
String alt,
String onclick)
Build a context path safe image tag for the supplied image path.
|
static String |
buildImageTag(javax.faces.context.FacesContext context,
String image,
int width,
int height,
String alt,
String onclick,
String verticalAlign)
Build a context path safe image tag for the supplied image path.
|
static String |
buildImageTag(javax.faces.context.FacesContext context,
String image,
String alt)
Build a context path safe image tag for the supplied image path.
|
static String |
buildImageTag(javax.faces.context.FacesContext context,
String image,
String alt,
String verticalAlign)
Build a context path safe image tag for the supplied image path.
|
static void |
encodeRecursive(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Helper to recursively render a component and it's child components
|
static String |
generateFormSubmit(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Generate the JavaScript to submit the parent Form.
|
static String |
generateFormSubmit(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String fieldId,
String fieldValue)
Generate the JavaScript to submit set the specified hidden Form field to the
supplied value and submit the parent Form.
|
static String |
generateFormSubmit(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String fieldId,
String fieldValue,
boolean valueIsParam,
Map<String,String> params)
Generate the JavaScript to submit set the specified hidden Form field to the
supplied value and submit the parent Form.
|
static String |
generateFormSubmit(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
String fieldId,
String fieldValue,
Map<String,String> params)
Generate the JavaScript to submit set the specified hidden Form field to the
supplied value and submit the parent Form.
|
static String |
getActionHiddenFieldName(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Get the hidden field name for any action component.
|
static javax.faces.component.UIForm |
getParentForm(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Return the parent UIForm component for the specified UIComponent
|
static javax.faces.component.UIComponent |
getParentNamingContainer(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Return the parent UIComponent implementing the NamingContainer interface for
the specified UIComponent.
|
static boolean |
isComponentDisabledOrReadOnly(javax.faces.component.UIComponent component)
Determines whether the given component is disabled or readonly
|
static void |
outputAttribute(javax.faces.context.ResponseWriter out,
Object attr,
String mapping)
Helper to output an attribute to the output stream
|
static void |
processActionMethod(javax.faces.context.FacesContext context,
javax.faces.el.MethodBinding method,
javax.faces.event.ActionEvent event)
Invoke the method encapsulated by the supplied MethodBinding
|
public static void outputAttribute(javax.faces.context.ResponseWriter out,
Object attr,
String mapping)
throws IOException
out - ResponseWriterattr - attribute value object (cannot be null)mapping - mapping to output as e.g. style="..."IOExceptionpublic static String getActionHiddenFieldName(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
public static void encodeRecursive(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
throws IOException
context - FacesContextcomponent - UIComponentIOExceptionpublic static String generateFormSubmit(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String fieldId, String fieldValue)
context - FacesContextcomponent - UIComponent to generate JavaScript forfieldId - Hidden field id to set value forfieldValue - Hidden field value to set hidden field too on submitpublic static String generateFormSubmit(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String fieldId, String fieldValue, Map<String,String> params)
context - FacesContextcomponent - UIComponent to generate JavaScript forfieldId - Hidden field id to set value forfieldValue - Hidden field value to set hidden field too on submitparams - Optional map of param name/values to outputpublic static String generateFormSubmit(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String fieldId, String fieldValue, boolean valueIsParam, Map<String,String> params)
context - FacesContextcomponent - UIComponent to generate JavaScript forfieldId - Hidden field id to set value forfieldValue - Hidden field value to set hidden field too on submitvalueIsParam - Determines whether the fieldValue parameter should be treated
as a parameter in the generated JavaScript, false will treat
the value i.e. surround it with single quotesparams - Optional map of param name/values to outputpublic static String generateFormSubmit(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
context - FacesContextcomponent - UIComponent to generate JavaScript forpublic static String buildImageTag(javax.faces.context.FacesContext context, String image, int width, int height, String alt, String onclick)
context - FacesContextimage - The local image path from the web folder with leading slash '/'width - Width in pixelsheight - Height in pixelsalt - Optional alt/title textonclick - JavaScript onclick event handler codeimg tagpublic static String buildImageTag(javax.faces.context.FacesContext context, String image, int width, int height, String alt, String onclick, String verticalAlign)
context - FacesContextimage - The local image path from the web folder with leading slash '/'width - Width in pixelsheight - Height in pixelsalt - Optional alt/title textonclick - JavaScript onclick event handler codeverticalAlign - Optional HTML alignment valueimg tagpublic static String buildImageTag(javax.faces.context.FacesContext context, String image, int width, int height, String alt)
context - FacesContextimage - The local image path from the web folder with leading slash '/'width - Width in pixelsheight - Height in pixelsalt - Optional alt/title textimg tagpublic static String buildImageTag(javax.faces.context.FacesContext context, String image, String alt)
context - FacesContextimage - The local image path from the web folder with leading slash '/'alt - Optional alt/title textimg tagpublic static String buildImageTag(javax.faces.context.FacesContext context, String image, String alt, String verticalAlign)
context - FacesContextimage - The local image path from the web folder with leading slash '/'alt - Optional alt/title textverticalAlign - Optional HTML alignment valueimg tagpublic static javax.faces.component.UIForm getParentForm(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
context - FaceContextcomponent - The UIComponent to find parent Form forpublic static javax.faces.component.UIComponent getParentNamingContainer(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
context - FaceContextcomponent - The UIComponent to find parent Form forpublic static boolean isComponentDisabledOrReadOnly(javax.faces.component.UIComponent component)
component - The component to testpublic static void processActionMethod(javax.faces.context.FacesContext context,
javax.faces.el.MethodBinding method,
javax.faces.event.ActionEvent event)
context - FacesContextmethod - MethodBinding to invokeevent - ActionEvent to pass to the method of signature:
public void myMethodName(ActionEvent event)Copyright © 2005–2017 Alfresco Software. All rights reserved.