I am using JSF, richfaces 4 stuff and i want to call a bean method when javascript function trigger.
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.
You can use
<a4j:jsFunction>, which allows you to perform Ajax requests to invoke the bean method directly from JavaScript code , and the response can be returned in a JSON format to use in a client JavaScript calls.Please note that
<a4j:jsFunction>is required to be inside a<h:form>.For example, you define the a4j:jsFunction likes this :
A javascript function which name called
myJsFunction()is created and it will invoke someAction() on the bean when being called.For example , in your javascript function :