Anybody?

> Hi,
>
> when I'm doing [1] in 1.4.17 in a quickstart then I'm getting nice urls
> ala ?q=something e.g. for typing something in the textfield. The problem
> is that it prints two GET requests (why not POST + GET?):
>
> NOW: q = "[todo]" query=todo GET
> NOW:              query=null GET
>
> In firebug I can see POST + GET:
>
> POST
> http://localhost:8080/wicket1.4.17/?wicket:interface=:0:searchform::IFormSubmitListener::
> GET http://localhost:8080/wicket1.4.17/?q=test
>
> How can I avoid the second call of HomePage with query=null?? When I do
> setRedirect(false) after setResponsePage I don't get the nice url but it
> prints only one POST request with the correct parameter:
>
> NOW: q = "test" query=test POST
>
> Finally I tried to explicitely set the form method to GET:
>
> @Override protected String getMethod() { return METHOD_GET; }
>
> but then I would need to declare every url parameter as hidden field or
> can I somehow overwrite the form action with my need parameters? About a
> similar problem was blogged here [2]
>
> Could someone enlight me whats going wrong here?
>
> Regards,
> Peter.
>
>
> [1]
> public HomePage(final PageParameters parameters) {
>
> Form form = new Form("searchform") {
>     @Override protected void onSubmit() {
>         PageParameters pp = new PageParameters();
>         pp.add("q", query);
>         // add other params from previous request
>         setResponsePage(HomePage.class, pp);
>     }
> };
> add(form);
> query = parameters.getString("q");
> TextField text = new TextField("textField", new PropertyModel(this,
> "query"));
> form.add(text);
>
> logger.info("NOW: " + parameters + " query=" + query + " " + getMethod());
>
> }
>
> public String getMethod() {
>  return ((WebRequest) getRequest()).getHttpServletRequest().getMethod();
> }
>
>
> [2]
> http://blog.solidcraft.eu/2010/10/wicket-form-submit-not-safe-for.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to