How can I show some loading message when making request using <f:ajax>?
How can I show some loading message when making request using <f:ajax> ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re not already using a 3rd party component library which could already have a ready-made component for that, such as PrimeFaces with
<p:ajaxStatus>, then you can use the JSF-provided JavaScriptfaces.ajax.addOnEvent()function (and eventually alsofaces.ajax.addOnError()) to hook a function on ajax events.Here’s a basic kickoff example:
See also section 13.3.5.2 of the Jakarta Faces 4.0 specification:
Note: in case you’re still using JSF 3.0 or older, then use
jsf.ajaxnamespace instead offaces.ajaxas injsf.ajax.addOnEvent(...).