JSF Showcase
f:passThroughAttributes
f:passThroughAttributes provides the same behaviour as f:passThroughAttribute but for multiple attributes at the same time.General Usage
For populating the attribute values, just setvalue
EL expression. This should return a Map<String,Object>
with the key being the attribute name, and its value the correspondent attribute value.
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:ui="http://xmlns.jcp.org/jsf/facelets"> <h:form> <h:inputText id="passThroughNumber" value="#{inputTextModelBean.text}"> <f:passThroughAttributes value="#{passThroughAttributesBackingBean.passthroughAttributes}"/> </h:inputText> <h:commandButton value="#{i18n['submit']}"> <f:ajax execute="passThroughNumber" render="@form"/> </h:commandButton> <h:outputText id="modelValue" value="#{inputTextModelBean.text}"/> </h:form> </ui:composition>
@ManagedBean @RequestScoped public class PassThroughAttributesBackingBean { public Map<String, Object> getPassthroughAttributes() { Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put("type", "number"); return attributes; } }
Liferay Faces Bridge Implementation 5.0.0 + Showcase Common 3.1.1 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20