jQuery ajax request and JSF request ajax uses a different js library, I donβt think it makes sense to try to mix them too much ...
If you want to run the JSF-controlled bean action from jQuery, you'd better use the hidden h:commandButton for this purpose ...
JSF:
<h:commandButton id="someId" action="#{someBean.someMethod}" style="display:none"> <f:ajax render="someId" execute="someId"/> </h:commandButton>
if you want to pass some more hidden arguments, you can add more hidden components of the JSF components to the hidden attribute h:commandButton execute , so their corresponding properties will be updated on the server side ...
Js
$("#someId").click();
On the other hand, if you want to use managed bean data in servlets that match your jQuery calls, you can always access this managed JSF data, for example: JSF - get a managed bean by name
source share