Reputation: 225
Is it possible to send ajax request manually in JSF ? If Possible Please Guide me .
Thanks in Advance.
Upvotes: 2
Views: 799
Reputation: 4524
Checkout OmniFaces <o:commandScript>
tag, seems nifty. Also contains lots of other interesting utility for JSF projects.
Upvotes: 0
Reputation: 14277
As you are using Primefaces there is JavaScript API for this. You can use PrimeFaces.ajax.AjaxRequest
to do this. See Primefaces Users Guide for this but simple example would be:
PrimeFaces.ajax.AjaxRequest({
formId: 'userForm',
source: 'userForm',
process: 'userForm'
});
This is example from users Guide.
Additionally there is p:remoteCommand
component with which you can create JavaScript function to call some method from backing bean if this is closer to your use case.
Upvotes: 2