You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Enes Fazli <fa...@googlemail.com> on 2008/11/17 09:40:08 UTC

Loosing page parameters after submit

Hello everybody,

following situation:

I have a comment panel with a form and a paging navigator to show the
comments. I implemented a own version of the PagingNavigator which uses
BookmarkablePageLinks for navigation links. Now, if i use this panel in a
page that has this url *http://localhost/sample/1111/test/* the link to the
second page of the PagingNavigator has a url according to that *
http://localhost/sample/1111/test/?commentspage=2*

If I now submit a comment the url to the second page of the PagingNavigator
changes to: *https://localhost:8443/sample/?commentspage=2

*My workaround at the moment is to set the response page in the form's
submit to the sample page with it's parameters. But I would have to do it
for every submitting panel in that page. I hope someone can give me a hint
on to why I lose the page parameters on submit.*
*
*For the sake of completeness:*
The page in which the Panel is embedded is mounted with a custom
UrlCodingStrategy which is a non versioned HybridUrlCodingStrategy extended
with the possibility to add mixed parameters.

I already tried other UrlCodingStrategies but that changed nothing.

Thanks,

Enes

Re: Loosing page parameters after submit

Posted by Jörn Zaefferer <jo...@googlemail.com>.
"That's how it is" isn't really that much helpful, there's always a
workaround, isn't there?

In thise case, saving the pageparameters in the form constructor and
using them to set the response page onSubmit helps. Something like
this:

class MyForm extends Form {
  private PageParameters pageParameters;
  public MyForm() {
    pageParameters = RequestCycle.get().getPageParameters();
    // other stuff
  }

  public void onSubmit() {
    // other stuff
    setResponsePage(getPage().getClass(), pageParameters);
  }

}

I guess there is a better solution, but at least it works in this case.

Jörn

On Mon, Nov 17, 2008 at 5:53 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> your complaint is not that you are losing page parameters, but that
> you are losing the url. thats just how wicket works...
>
> -igor
>
> On Mon, Nov 17, 2008 at 12:40 AM, Enes Fazli <fa...@googlemail.com> wrote:
>> Hello everybody,
>>
>> following situation:
>>
>> I have a comment panel with a form and a paging navigator to show the
>> comments. I implemented a own version of the PagingNavigator which uses
>> BookmarkablePageLinks for navigation links. Now, if i use this panel in a
>> page that has this url *http://localhost/sample/1111/test/* the link to the
>> second page of the PagingNavigator has a url according to that *
>> http://localhost/sample/1111/test/?commentspage=2*
>>
>> If I now submit a comment the url to the second page of the PagingNavigator
>> changes to: *https://localhost:8443/sample/?commentspage=2
>>
>> *My workaround at the moment is to set the response page in the form's
>> submit to the sample page with it's parameters. But I would have to do it
>> for every submitting panel in that page. I hope someone can give me a hint
>> on to why I lose the page parameters on submit.*
>> *
>> *For the sake of completeness:*
>> The page in which the Panel is embedded is mounted with a custom
>> UrlCodingStrategy which is a non versioned HybridUrlCodingStrategy extended
>> with the possibility to add mixed parameters.
>>
>> I already tried other UrlCodingStrategies but that changed nothing.
>>
>> Thanks,
>>
>> Enes
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Loosing page parameters after submit

Posted by Igor Vaynberg <ig...@gmail.com>.
your complaint is not that you are losing page parameters, but that
you are losing the url. thats just how wicket works...

-igor

On Mon, Nov 17, 2008 at 12:40 AM, Enes Fazli <fa...@googlemail.com> wrote:
> Hello everybody,
>
> following situation:
>
> I have a comment panel with a form and a paging navigator to show the
> comments. I implemented a own version of the PagingNavigator which uses
> BookmarkablePageLinks for navigation links. Now, if i use this panel in a
> page that has this url *http://localhost/sample/1111/test/* the link to the
> second page of the PagingNavigator has a url according to that *
> http://localhost/sample/1111/test/?commentspage=2*
>
> If I now submit a comment the url to the second page of the PagingNavigator
> changes to: *https://localhost:8443/sample/?commentspage=2
>
> *My workaround at the moment is to set the response page in the form's
> submit to the sample page with it's parameters. But I would have to do it
> for every submitting panel in that page. I hope someone can give me a hint
> on to why I lose the page parameters on submit.*
> *
> *For the sake of completeness:*
> The page in which the Panel is embedded is mounted with a custom
> UrlCodingStrategy which is a non versioned HybridUrlCodingStrategy extended
> with the possibility to add mixed parameters.
>
> I already tried other UrlCodingStrategies but that changed nothing.
>
> Thanks,
>
> Enes
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org