0 Replies Latest reply on Sep 19, 2010 6:23 AM by ravi krishna muthireddy

    Getting Hidden value set in javascript in Backing Bean

    ravi krishna muthireddy Newbie

      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(){
         
      //value changes dynamically everytime this function is called
          document
      .getElementById('form1:fileName').value = '123';
      }


      This is the generated html part

      .<input id="case:sendMail" name="case:sendMail"
      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