|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.extensions.webscripts.ui.common.JSFUtils
public final class JSFUtils
Class containing misc helper methods for managing JSF Components. NOTE: Extracted from org.alfresco.web.ui.common.Utils;
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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="..."
IOException
public 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
- UIComponent
IOException
public 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 submit
public 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 output
public 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 output
public static String generateFormSubmit(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
context
- FacesContextcomponent
- UIComponent to generate JavaScript for
public 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 code
img
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 value
img
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 text
img
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 text
img
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 value
img
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 for
public static javax.faces.component.UIComponent getParentNamingContainer(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
context
- FaceContextcomponent
- The UIComponent to find parent Form for
public static boolean isComponentDisabledOrReadOnly(javax.faces.component.UIComponent component)
component
- The component to test
public 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |