actually i have a inputTextarea , and i want to get the value from it and append some values, before action takes place in BackingBean. how to achieve this! I tried but the a4j:commandLink does not invoke action after calling javascript on onClick event.
i refers this reference action method is not called in <a4j:commandLink> tag
How can I execute Javascript before a JSF <h:commandLink> action is performed?
http://balusc.blogspot.in/2009/05/javajspjsf-and-javascript.html Actually My code:
JavaScript in common file
function call()
{
var test= document.getElementById('inputId').value;
test="hai"; //some code
document.getElementById('inputId').value=test;
return true;
}
in jsf
<a4j:commandLink onclick="if (!call()) return false;"
action="#{bean.createUser()}"
execute="@form">
<h:graphicImage style="border-style:none;" url="/images/create.jpg"
height="10px" />
</a4j:commandLink>