Is it possible to do:
jsf code (pseudo):
...
<f:param name="arg" value="document.getElementById('naming').text()">
<h:inputText id="naming"></h:inputText>
...
I mean approach,when <f:param> is set with JS.
Is it bad practice?
Thanks for help.
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 need to use a4j’s
commandButtonandactionParamto be able to pass a dynamic param back to the server.Additionally, you need an attribute on your bean that will receive the param value.
Example:
Here
myBean.myBeanArgwill receive the value returned by the javascript functiongetTheValue().Notice the
noEscape="true"attribute. This is needed because otherwise the data insidevaluewould be enclosed in single quotes and escaped, resulting in no javascript execution. As stated in the documentation: