public final class Components extends Object
Modifier and Type | Method and Description |
---|---|
static Object |
evalAttribute(UIComponent component,
String name)
Evaluates an attribute of a component by first checking if there's a value expression associated with it, and only if there isn't one
look at a component property with that name.
|
static String |
graphicImageURL(String expression)
Returns
@GraphicImageBean URL based on given expression string. |
static String |
graphicImageURLWithType(String expression,
String type)
Returns
@GraphicImageBean URL based on given expression string and image type. |
static String |
graphicImageURLWithTypeAndLastModified(String expression,
String type,
Object lastModified)
Returns
@GraphicImageBean URL based on given expression string, image type and last modified. |
public static Object evalAttribute(UIComponent component, String name)
The regular attribute collection (UIComponent.getAttributes()
) does exactly the reverse; it looks at a component property
first, then at the attribute collection and only looks at a value binding as the last option.
component
- The component for which the attribute is to be evaluatedname
- Name of attribute that is to be evaluatedpublic static String graphicImageURL(String expression)
Returns @GraphicImageBean
URL based on given expression string.
Usage example:
<a href="#{of:graphicImageURL('images.full(product.imageId)')}"> <o:graphicImage value="#{images.thumb(product.imageId)}" /> </a>
expression
- Expression string representing the same value as you would use in
<o:graphicImage>
. It must be a quoted string. Any nested quotes can be escaped with backslash.@GraphicImageBean
URL based on given expression string.GraphicImageBean
,
GraphicImage
public static String graphicImageURLWithType(String expression, String type)
Returns @GraphicImageBean
URL based on given expression string and image type.
Usage example:
<a href="#{of:graphicImageURLWithType('images.full(product.imageId)', 'png')}"> <o:graphicImage value="#{images.thumb(product.imageId)}" type="png" /> </a>
expression
- Expression string representing the same value as you would use in
<o:graphicImage>
. It must be a quoted string. Any nested quotes can be escaped with backslash.type
- The image type, represented as file extension.
E.g. "jpg", "png", "gif", "ico", "svg", "bmp", "tiff", etc. This may be null
.@GraphicImageBean
URL based on given expression string and image type.GraphicImageBean
,
GraphicImage
public static String graphicImageURLWithTypeAndLastModified(String expression, String type, Object lastModified)
Returns @GraphicImageBean
URL based on given expression string, image type and last modified.
Usage example:
<a href="#{of:graphicImageURLWithTypeAndLastModified('images.full(product.imageId)', 'png', product.lastModified)}"> <o:graphicImage value="#{images.thumb(product.imageId)}" type="png" lastModified="#{product.lastModified}" /> </a>
expression
- Expression string representing the same value as you would use in
<o:graphicImage>
. It must be a quoted string. Any nested quotes can be escaped with backslash.type
- The image type, represented as file extension.
E.g. "jpg", "png", "gif", "ico", "svg", "bmp", "tiff", etc. This may be null
.lastModified
- The "last modified" timestamp, can be either a Long
, Date
, or String
which is parseable as Long
. This may be null
.@GraphicImageBean
URL based on given expression string, image type and last modified.GraphicImageBean
,
GraphicImage
Copyright © 2012–2021 OmniFaces. All rights reserved.