Problems with the HTML id-Attribute and Java Server Faces

I had some problems using the id-Attribute to identify a JSF component from Javascript. The reason is that naming containers of JSF modify the id of their contained components. This has advantages and disadvantages. If you are using Javascript or CSS and need to identify a component, it is a disadvantage ;) The problem is known and the solution I used was using forceId of Tomahawk/Myfaces. It was the simplest thing to do, although it is not that nice to have really static ids.

You can use the Tomahawk components by changing the XML-prefix of your components in your JSF-Code from h: to t: .. that’s it :)