Converter for JSF passthrough input element ("HTML5 friendly markup")

1.2k Views Asked by At

I'm using a passthrough element inside Facelet page like this:

<input jsf:value="#{...}"/>

And I'd like to attach a Converter to it. How can I achieve this?

1

There are 1 best solutions below

2
On BEST ANSWER

Just the same way as when you would be using a normal JSF <h:inputText> component instead of plain HTML, with either the converter attribute

<input jsf:value="#{...}" jsf:converter="fooConverter" />

or the <f:converter> tag.

<input jsf:value="#{...}">
    <f:converter converterId="fooConverter" />
</input>

Table 8-4 of the Java EE 7 tutorial lists which JSF component the given passthrough element will ultimately be converted to, before insertion in the JSF component tree. The Facelets VDL lists all available tags+attributes for those JSF components.