6.4.1.
<
a4j:include
>
available since 3.0.0
The
<a4j:include>
component is used to include one view as part of another and navigate there using standard JSF navigation.
Table 6.41. a4j
:
include
attributes
Attribute Name |
Description
|
---|
ajaxRendered | Defines, whether the content of this component must be
(or not) included in AJAX response created by parent
AJAX Container, even if it is not forced by reRender
list of ajax action. Ignored if component marked to output by some Ajax action component.
Default value is "true". |
binding | JSF: The attribute takes a value-binding expression for a component property of
a backing bean |
dir | HTML: Direction indication for text that does not inherit
directionality. Valid values are "LTR" (left-to-right)
and "RTL" (right-to-left) |
id | JSF: Every component may have a unique id that is automatically created if omitted |
keepTransient | Flag for mark all child components to non-transient. If
true, all children components will be set to non-transient state
and keep in saved components tree. For output in self-renderer
region all content ( By default, all content in <f:verbatim>
tags and non-jsf elements in facelets, marked as transient -
since, self-rendered ajax regions don't plain output for ajax
processing ). |
lang | HTML: Code describing the language used in the generated markup for this component |
layout | HTML layout for generated markup. Possible values: "block"
for generating an HTML <div> element, "inline" for
generating an HTML <span> element, and "none" for generating
no HTML element. There is a minor exception for the "none" case
where a child element has the property "rendered" set to "false".
In this case, we create an empty <span> element with same ID
as the child element to use as a placeholder for later
processing. Default value is "inline" |
rendered | JSF: If "false", this component is not rendered |
style | HTML: CSS style rules to be applied to the component |
styleClass | JSF: Assigns one or more CSS class names to the component. Corresponds to the HTML "class" attribute. |
title | HTML: Advisory title information about markup elements generated for this component |
viewId | Specifies the view id of a page that is included. |
Table 6.42. Component identification parameters
Name | Value |
---|
component-type | org.ajax4jsf.Include |
component-family | javax.faces.Output |
component-class | org.ajax4jsf.component.html.Include |
renderer-type | org.ajax4jsf.components.AjaxIncludeRenderer |
6.4.1.2. Creating the Component with a Page Tag
To create the simplest variant of the component on a page use the following syntax:
Example:
<h:panelGrid>
<a4j:include viewId="/pages/include/first.xhtml" />
</rich:panelGrid>
6.4.1.3. Creating the Component Dynamically Using Java
This component cannot be created dynamically.
6.4.1.4. Details of usage
The component is used to include one view as part of another and may be put anywhere in the page code.
The
'viewID'
attribute is used to point at the part to be included and should present a full context-relative path of the resource in order to be used as from-view and to-view in the JSF navigation cases.
In general the component functions as Fecelets
<ui:include>
tag but with partial page navigation in Ajax mode as an advantage.
Note:
To make the RichFaces
<a4j:include>
component (as well as Facelets
<ui:include>
tag) work properly when including the part of the page check that included page does not generates extra HTML <!DOCTYPE>, <html>, <body> tags.
The navigation rules could look as following:
Example:
<navigation-rule>
<from-view-id>/pages/include/first.xhtml</from-view-id>
<navigation-case>
<from-outcome>next</from-outcome>
<to-view-id>/pages/include/second.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
6.4.1.5. Relevant resources links
Vizit the Include page for examples of component usage and their sources.