posted 10 years ago
If you know basic jQuery, you can make it work with JSF, although some JSF extension tagsets (such as RichFaces) also include jQuery support tags.
There are only a few "gotchas":
1. Don't use the "$" notation when mixing jQuery and JSF. The "$" is interpreted by the EL processor to mean JSP-style value substitution. Use the "jQuery." form, instead.
2. JSF has something called a naming container that causes the actual HTML IDs of the raw output to be more complex than the simple IDs that you code in JSF View Definition Language. jQuery, like all JavaScript, needs the HTML ID values, not the JSF ID values. When in doubt, "View Page Source" in your browser.
3. The jQuery that's bundled in with some of the JSF extension tagsets may be very antiquated. You will have to either code down to their level or take steps to make sure that the proper version of jQuery for the features you need is being pulled in (and doesn't collide).
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.