Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSF 2.0 strips out needed HTML5 attributes [duplicate]

Tags:

html

jsf

I work with a JSF team doing the front end development. We're outputting an INPUT field and I need to include placeholder and a few data- attributes into the rendered tag. The JSF is stripping these out, however. I don't know JSF enough to be of much help to the JSF team, but thought I could at least ask around.

We were using an older version of JSF but upgraded to 2.0 as it appeared that it would support HTML5. Is that not the case? Is there a known way to work around this?

like image 998
DA. Avatar asked Jul 12 '11 16:07

DA.


1 Answers

JSF isn't exactly stripping them out. It's just ignoring them because they are not among the supported/known attributes of the component in question. In case of for example <h:inputText> (which renders by default a HTML <input type="text"> tag), you can find all supported attributes in the view declaration language (VDL) documentation.

To overcome this, you would need to create a custom component or, better, just a custom renderer which overrides the standard <h:inputText> renderer and takes the custom attributes into account.

like image 163
BalusC Avatar answered Nov 11 '22 03:11

BalusC