Portal Showcase


Thanks to f:passThroughAttribute (since JSF 2.2) its possible to specify custom values for HTML attributes that doesnt exist in the tag where it is used.

General Usage

For this example, you will need an HTML5 capable browser. We are using a known HTML5 attribute for input elements, which will let us to render a number spinner using the native feature in browser.

Source Code

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:p="http://xmlns.jcp.org/jsf/passthrough"

		<h:inputText id="passThroughNumber" p:type="number" value="#{inputTextModelBean.text}"/>
		<h:commandButton value="#{i18n['submit']}">
			<f:ajax execute="passThroughNumber" render="@form"/>
		<h:outputText id="modelValue" value="#{inputTextModelBean.text}"/>

public class InputTextModelBean {

	private Date date = new GregorianCalendar().getTime();
	private String text;

	public Date getDate() {
		return date;

	public String getText() {
		return text;

	public void setDate(Date date) {
		this.date = date;

	public void setText(String text) {
		this.text = text;
Liferay Faces Bridge Implementation 4.0.0 + Liferay Faces Portal 3.0.0 + Showcase Common 3.0.0 + Liferay Faces Util 3.0.0 + Mojarra 2.2.13