Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF integration jquery

 
Dura Hurtado
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi , I have been using jquery in my .jsf app but it just works with .html components. I am a begginer in jquery and I am looking for the easiest way to use it in .xhtml files.

¿Which is the right way?

¿Any clue?

Thanks
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not only does jQuery work just fine in JSF, the RichFaces JSF extension tagset even uses it (under cover) to do its AJAX functions!

However, you may run into difficulties in properly addressing objects, because the "id" attributes on JSF tags aren't their "real" IDs as seen by JavaScript/jQuery. You have to use the internally-generated IDs, which you can obtain by examining the generated HTML ("View Page Source"). Note that automatically-generated ID components can change names unpredictably, so for maximum reliability you should explicitly ID naming containers such as forms and dataTables.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic