6.10. PortletFaces Composite Component Tags

PortletFaces provides the following Facelet Composite Component tags as part of its component suite.

Table 6.8. Facelet Composite Component Tags

Tag Description
pf:iceInfoDataPaginator Encapsulates an ICEfaces ice:dataPaginator tag that renders pagination information for an associated ice:dataTable. The navigation information will match the internationalized Liferay "showing-x-x-of-x-results" message.
pf:iceNavDataPaginator Encapsulates an ICEfaces ice:dataPaginator tag that renders navigation controls for an associated ice:dataTable. The icons will match the current Liferay theme.
pf:icon Encapsulates an HTML img tag whose src attribute contains a fully qualified URL to an icon in the Liferay theme.
pf:messages Encapsulates the h:messages tag and automatically applies the JSR 286 standard class names.
pf:message Encapsulates the h:message tag and automatically applies the JSR 286 standard class names.

6.10.1. The pf:iceInfoDataPaginator tag

The pf:iceInfoDataPaginator encapsulates an ICEfaces ice:dataPaginator tag that renders pagination information for an associated ice:dataTable. The navigation information will match the internationalized Liferay "showing-x-x-of-x-results" message.

Table 6.9. Attributes

Attribute Type Description Required
for String Corresponds to the value of an id attribute for an ice:dataTable tag. true
value String Specifies a string that contains replacement tokens for each piece of pagination information. The default value is the internationalized Liferay "showing-x-x-of-x-results" message. true

Example 6.50. Example usage of pf:iceInfoDataPaginator tag

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ice="http://www.icesoft.com/icefaces/component"
	xmlns:pf="http://portletfaces.org/facelets">

	<pf:iceInfoDataPaginator for="dataTable1" />
	<ice:dataTable id="dataTable1" value="#{modelManagedBean.rows}" var="row">
		...
	</ice:dataTable>

</f:view>

6.10.2. The pf:iceNavDataPaginator tag

The pf:iceInfoDataPaginator encapsulates an ICEfaces ice:dataPaginator tag that renders navigation controls for an associated ice:dataTable. The icons will match the current Liferay theme.

Table 6.10. Attributes

Attribute Type Description Required
fastForwardIconRendered Boolean Boolean flag indicating whether or not the "Fast Forward" button/icon is rendered. The default value is "false". false
fastRewindIconRendered Boolean Boolean flag indicating whether or not the "Fast Rewind" button/icon is rendered. The default value is "false". false
firstIconRendered Boolean Boolean flag indicating whether or not the "First" button/icon is rendered. The default value is "true". false
for String Corresponds to the value of an id attribute for an ice:dataTable tag. true
lastIconRendered Boolean Boolean flag indicating whether or not the "Last" button/icon is rendered. The default value is "true". false
nextIconRendered Boolean Boolean flag indicating whether or not the "Next" button/icon is rendered. The default value is "true". false
paginator Boolean Boolean flag indicating whether or not the page number links will be rendered. This is a pass-through attribute for the encapsulated ice:dataPaginator. The default value is "true". false
paginatorMaxPages Integer The maximum amount of pages to be displayed in the paginator. This is a pass-through attribute for the encapsulated ice:dataPaginator. The default value is 7. false
previousIconRendered Boolean Boolean flag indicating whether or not the "Previous" button/icon is rendered. The default value is "true". false

Example 6.51. Example usage of pf:iceNavDataPaginator tag

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ice="http://www.icesoft.com/icefaces/component"
	xmlns:pf="http://portletfaces.org/facelets">

	<pf:iceNavDataPaginator for="dataTable1" />
	<ice:dataTable id="dataTable1" value="#{modelManagedBean.rows}" var="row">
		...
	</ice:dataTable>

</f:view>

6.10.3. The pf:icon tag

The pf:icon tag encapsulates an HTML img tag whose src attribute contains a fully qualified URL to an icon image in the current Liferay theme.

Table 6.11. Attributes

Attribute Type Description Required
alt String Corresponds to the value of the alt attribute for the embedded img tag. The default value is Liferay's internationalized message for the key named view. false
image String The name of the theme image icon, which can be the prefix of any image filename in the Liferay theme's "common" image folder. The default value is view. false

Example 6.52. Example usage of pf:icon tag

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ice="http://www.icesoft.com/icefaces/component"
	xmlns:pf="http://portletfaces.org/facelets">

	<pf:icon alt="#{i18n['delete']}" image="delete" />

</f:view>

6.10.4. The pf:messages tag

The pf:messages tag encapsualtes the h:messages tag and automatically applies the JSR 286 standard class names. See Liferay Theme Integration for more information.

Table 6.12. Attributes

Attribute Type Description Required
globalOnly Boolean Boolean flag indicating whether or not only global messages should be rendered. false.

Example 6.53. Example usage of pf:messages tag

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<f:view xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ice="http://www.icesoft.com/icefaces/component"
	xmlns:pf="http://portletfaces.org/facelets">

	<h:form>
		<pf:messages globalOnly="true" />
		<h:panelGrid columns="3">
			<h:outputLabel for="dateOfBirth" />
			<h:inputText id="dateOfBirth" value="#{modelManagedBean.dateOfBirth}" />
			<pf:messages for="dateOfBirth" />
		</h:panelGrid>
		<h:commandButton action="#{backingManagedBean.submit}" />
	</h:form>
	
</f:view>

6.10.5. The pf:message tag

The pf:message tag encapsualtes the h:message tag and automatically applies the JSR 286 standard class names. See Liferay Theme Integration for more information.

Table 6.13. Attributes

Attribute Type Description Required
for String Corresponds to the value of the id attribute of an associated JSF component tag such as h:inputText or h:selectOneMenu. true

Example 6.54. Example usage of pf:message tag

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ice="http://www.icesoft.com/icefaces/component"
	xmlns:pf="http://portletfaces.org/facelets">

	<h:form>
		<pf:messages globalOnly="true" />
		<h:panelGrid columns="3">
			<h:outputLabel for="dateOfBirth" />
			<h:inputText id="dateOfBirth" value="#{modelManagedBean.dateOfBirth}" />
			<pf:messages for="dateOfBirth" />
		</h:panelGrid>
		<h:commandButton action="#{backingManagedBean.submit}" />
	</h:form>

</f:view>