Seam includes a number of JSF controls that are useful for working with Seam. These are intended to complement the built-in JSF controls, and controls from other third-party libraries. We recommend the Ajax4JSF and ADF faces (now Trinidad) tag libraries for use with Seam. We do not recommend the use of the Tomahawk tag library.
The ui example demonstrates the use of a number of these tags.
Validate a JSF input field against the bound property using Hibernate Validator.
Validate all child JSF input fields against the bound propertys using Hibernate Validator.
Output Seam Text.
Perform date or time conversions in the Seam timezone.
Assigns an enum converter to the current component. This is primarily useful for radio button and dropdown controls.
Creates a SelectItem from an enum value.
enumValue — the string representation of the enum value.
label — the label to be used when rendering the SelectItem.
Creates a List<SelectItem> from a List, Set, DataModel or Array.
value — an EL expression specifying the data that backs the List<SelectItem>
var — defines the name of the local variable that holds the current object during iteration
label — the label to be used when rendering the SelectItem. Can reference the var variable
disabled — if true the SelectItem will be rendered disabled. Can reference the var variable
noSelectionLabel — specifies the (optional) label to place at the top of list (if required="true" is also specified then selecting this value will cause a validation error)
hideNoSelectionLabel — if true, the noSelectionLabel will be hidden when a value is selected
"Decorate" a JSF input field when validation fails.
"Decorate" a JSF input field with the validation error message.
Render a HTML <span>.
Render a HTML <div>.
A non-rendering component useful for enabling/disabling rendering of it's children
Cache the rendered page fragment using JBoss Cache. Note that <s:cache> actually uses the instance of JBoss Cache managed by the built-in pojoCache component.
key — the key to cache rendered content, often a value expression. For example, if we were caching a page fragment that displays a document, we might use key="Document-#{document.id}".
enabled — a value expression that determines if the cache should be used.
region — a JBoss Cache node to use (different nodes can have different expiry policies).
A link that supports invocation of an action with control over conversation propagation. Does not submit the form.
value — the label.
action — a method binding that specified the action listener.
view — the JSF view id to link to.
fragment — the fragment identifier to link to.
disabled — is the link disabled?
propagation — determines the conversation propagation style: begin, join, nest, none or end.
pageflow — a pageflow definition to begin. (This is only useful when propagation="begin" or propagation="join".)
A button that supports invocation of an action with control over conversation propagation. Does not submit the form.
value — the label.
action — a method binding that specified the action listener.
view — the JSF view id to link to.
fragment — the fragment identifier to link to.
disabled — is the link disabled?
propagation — determines the conversation propagation style: begin, join, nest, none or end.
pageflow — a pageflow definition to begin. (This is only useful when propagation="begin" or propagation="join".)
Displays a dynamic date picker component that selects a date for the specified input field. The body of the selectDate element should contain HTML elements, such as text or an image, that prompt the user to click to display the date picker. The date picker can be styled using CSS. An example CSS file can be found in the Seam booking demo as date.css.
for — The id of the input field that the date picker will insert the selected date into.
dateFormat — The date format string. This should match the date format of the input field.
Customize the conversation propagation for a command link or button (or similar JSF control). Facelets only.
propagation — determines the conversation propagation style: begin, join, nest, none or end.
pageflow — a pageflow definition to begin. (This is only useful when propagation="begin" or propagation="join".)
Add the conversation id to an output link (or similar JSF control). Facelets only.
Add the task id to an output link (or similar JSF control), when the task is available via #{task}. Facelets only.
Renders a file upload control. This control must be used within a form with an encoding type of multipart/form-data, i.e:
<h:form enctype="multipart/form-data">
For multipart requests, the Seam Multipart servlet filter must also be configured in web.xml:
<filter> <filter-name>Seam Filter</filter-name> <filter-class>org.jboss.seam.web.SeamFilter</filter-class> </filter> <filter-mapping> <filter-name>Seam Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
The following configuration options for multipart requests may be configured in components.xml:
createTempFiles — if this option is set to true, uploaded files are streamed to a temporary file instead of in memory.
maxRequestSize — the maximum size of a file upload request, in bytes.
Here's an example:
<component class="org.jboss.seam.servlet.MultipartConfig"> <property name="createTempFiles">true</property> <property name="maxRequestSize">1000000</property> </component>
And here's a list of the supported attributes for the fileUpload control:
data — this value binding receives the binary file data. The receiving field should be declared as a byte[] or InputStream (required).
contentType — this value binding receives the file's content type (optional).
fileName — this value binding receives the filename (optional).
accept — a comma-separated list of content types to accept, may not be supported by the browser. E.g. "images/png,images/jpg", "images/*".
style — The control's style
styleClass — The control's style class