Hi All,
JSF:
<h:inputHidden id="fileName" value="#{TestBean.fileName}" />
<a4j:commandButton id="button" value="Send Mail" action="#{TestBean.send}" onclick="onCall()"/>
JS:function onCall(){
.<input id="case:sendMail" name="case:sendMail"
//value changes dynamically everytime this function is called
document.getElementById('form1:fileName').value = '123';
}
This is the generated html part
onclick="onCall();A4J.AJAX.Submit('case:j_id_jsp_24982259_24','case',event,{'parameters':{'case:sendMail':'case:sendMail'},'actionUrl':'/SEAD/faces/trends.jsp'});return
false;" value="Send Mail" type="button" />
For the first time when we run it is fetching null value and from next time it is fetching previous value.
please suggest me where i went wrong.
Posted in Forum Plesae find the below link:
http://stackoverflow.com/questions/3691084/get-hidden-value-set-by-javascript-in-jsf-backing-bean