If you try to use jQuery to interact with JSF Richfaces components, you might run into difficulty selecting those components using their ID. The match is never made for some reason. That "reason" might very well be that RichFaces tends to put colons in the ID's of their generated DOM elements. For example:
There's nothing wrong with this. It's very well structured and successfully handles nested components and collections. But, if you try to get jQuery to select the component matching this ID, you'll fail because of the colons. The solution is to properly escape the colons in the ID before passing it to the selector:
var componentId = component.id;
componentId = componentId.replace(/:/g,"\:");var $component =jQuery("#"+ componentId);
Hope this helps.
Post Follow-ons
or
Leave a comment
Join my email list and be notified whenever a new post is published.
I don't spam. You may unsubscribe at any time.
An unsubscribe link is provided at the bottom of all notification emails, which are sent using the Mailchimp email delivery platform. Please read my complete privacy policy for exhaustive details.
Thank you! Your comment has been submitted and is awaiting approval.
Unfortunately, we were unable to process your submission.
You may either your submission or reach out via
It looks like you are using an older browser.
As such, most/all interactive functionality (such as submitting comments) has been disabled.
Please consider upgrading your browser.
Congratulations! You are now subscribed to this post and will receive an email notification whenever a new comment is added.
If you would like to unsubscribe, click on the unsubscribe link provided at the bottom of every notification email.
Unfortunately, we were unable to process your subscription confirmation.
You might want to try clicking through your confirmation email again.
Alternatively, you can submit another comment and again opt to subscribe to follow-up comments.
Leave a comment