Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-828

Using form method=get does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2.6, 1.3.0-beta2
    • 1.2.7, 1.3.0-beta3
    • None
    • None
    • All

    Description

      I'm trying to use form method="get" instead of post. In wicket 1.3.0-beta2 I override the getMethod() in Form to return METHOD_GET instead of the default METHOD_POST. In wicket 1.2.6 I do like this:
      Form form = new Form("form") {
      @Override
      protected void onComponentTag(ComponentTag tag)

      { super.onComponentTag(tag); tag.put("method", "get"); }

      };

      Both of these options seems to work as far as rendering the html page is concerned but you cannot submit anything. But when submitting a request all that's happening is that the navigation bar displays the URL in the form of e.g. http://localhost:8080/wickettest/app/?form0_hf_0=&firstName=johan&lastName=haleby&button=Submit+Query . I.e. all wicket component navigation info seems to be lost and wicket cannot determine the IFormListener and instead
      defaults to the HomePage.

      Also one thing that may be addressed is that if you have declared a form in your html as e.g.
      <form wicket:id="form" method="get">
      ..
      </form>
      the method should not automatically be transformed to post. Or perhaps there is a reason for doing this that I'm not aware of.

      Attachments

        Activity

          People

            ehillenius Eelco Hillenius
            johanhaleby Johan Haleby
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: