JSF 2.2 Pass Through Attributes

JSF 2.2 has a great feature to add dynamic attributes to a component on runtime, these attributes are called pass through attributes. PrimeFaces 4.0 is aimed to support JSF 2.0, 2.1 and 2.2 at the same time using runtime detection and lately pass through attributes support is added to 4.0;

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:pt="http://xmlns.jcp.org/jsf/passthrough" xmlns:p="http://primefaces.org/ui"> <h:head> </h:head> <h:body> <p:inputText value="#{bean.value}" pt:placeholder="Watermark here"/> </h:body> </html> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 <html xmlns = "http://www.w3.org/1999/xhtml" xmlns : h = "http://xmlns.jcp.org/jsf/html" xmlns : pt = "http://xmlns.jcp.org/jsf/passthrough" xmlns : p = "http://primefaces.org/ui" > <h:head> </h:head> <h:body> <p:inputText value = "#{bean.value}" pt : placeholder = "Watermark here" /> </h:body> </html>

Special thanks to PrimeFaces Friend Rudy De Busscher for his contribution regarding the implementation.