I support AJAX JSF2 application, and we are committed to using tags h:commandLinksand f:ajaxfor all actions - always reversing what you need.
This, of course, violates the expected behavior of the user when correctly clicking on the links and selecting "Open the link in a new tab", etc.
I understand that f: ajax forces the href attribute of the resulting element to abe #and performs the entire magic attack of the request in the onclick function - now I want to provide auxiliary support for "Open Link ..." by adding some meaningful link to the href attribute of the resulting tag <a>.
This will not violate the “normal” behavior of onclick, since the generated javascript always ends with return false;, but will allow me to send my users to a page using a regular GET request if they want to open the link in a new window.
Is there any way to do this? Or can someone point me in the right direction, where in the JSF life cycle will I have to jump in to do this, possibly using a phase listener?
source
share