1 Reply Latest reply on Apr 3, 2008 3:56 PM by John Smith

    Accessing <input type="hidden" form fields

    John Smith Newbie

      I am trying to access hidden POST data from a standard HTML form from seam:



      <form name="searchCriteria" action="/search/criteria.seam" method="post">
           <input type="hidden" name="hiddenGenreSelection"  />
      </form>



      @RequestParameter


       @RequestParameter 
      private String hiddenGenreSelection;



      doesn't work maybe due to this being used only for GET request parameters.



      Reverting to the servlet api :


                HttpServletRequest httpServletRequest = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
                Enumeration<String> enumeration = httpServletRequest.getParameterNames();
                while(enumeration.hasMoreElements()) {
                     String name = enumeration.nextElement();
                     log.debug("name #0 #1", name, httpServletRequest.getParameter(name));
                }



      returns null as well, perhaps because the post data has already been read.


      Is there I way to access POST data from a plain html form without using JSF or another view technology? My main issue is that a bespoke javascript tree writes to the form and I couldn't get javascript to write to a JSF form (that is populate a h:inputHidden) box. If anyone can tell me how to populate JSF components from javascript and have seam understand them, it would be much appreciated!


      thanks!