6 Replies Latest reply on Jul 11, 2011 12:26 PM by Nick Belaevski

    Not getting <h:inputHidden> value inside an action

    Nikita Sumeiko Newbie

      I have the following code:

       

      <h:form>
           <h:inputHidden id="myHidden" binding="#{myBindingConnector}" />
      
           <a4j:jsFunction name="callFunction" actionListener="#{...}" />
      </h:form>
      <h:form>
           <a href="#" onclick="fillFunction(); return false;" value="click this" />
      </h:form>
      
      <script type="text/javascript">
           fillFunction(){
                jQuery("input[id$='myHidden']").val("my new value");
                // $= means id contains
                
                setTimeout(function(){
                     callFunction();
                }, 1000);
           }
      </script>
      

       

      So, when I am clicking on a link, I am passing a new value into myHidden input with jQuery, and after 1 second calling callFunction, which is a connector to BackEnd. Than inside the action I am calling I don't get value of hidden input, which has to come from myBindingConncetor. Do you know why?