You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Wayne W <wa...@gmail.com> on 2014/10/16 19:16:46 UTC

Anyway of stopping this?

Hi,

we have a simple search form:

Form<String> form = new Form<String>("searchForm") {

@Override

protected void onSubmit() {

PageParameters params = new PageParameters();

params.add("0", search);

setResponsePage(SearchResultsPage.class, params);

}


 };


This displays a list of results with each row having a BookmarkablePageLink
to another page. If the user uses the form , the results are displayed.
Then they click on any of the links they are taken to the next page.


However when they click 'Back' on the browser they always get 'Confirm Form
Resubmission' in Chrome, 'Document Expired' in Firefox etc. How can we stop
this and just display the result page?


What I actually see in the URLs is:

server.com/searchFormPage

server.com?34-1.IFormSubmitListener-baseCont-search-searchForm

server.com/specificPage/842978

Then they click on back and you get

server.com?34-1.IFormSubmitListener-baseCont-search-searchForm

Re: Anyway of stopping this?

Posted by Wayne W <wa...@gmail.com>.
Ah sorry please ignore me. It seems we had this in the code:

// use this page renderer provider to avoid useless 302 redirections

setPageRendererProvider(new IPageRendererProvider() {

@Override

public PageRenderer get(RenderPageRequestHandler context) {

return new WebPageRenderer(context) {

@Override

protected RedirectPolicy getRedirectPolicy() {

RedirectPolicy result;

if (!((WebRequest) RequestCycle.get().getRequest()).isAjax()) {

result = RedirectPolicy.NEVER_REDIRECT;

} else {

result = super.getRedirectPolicy();

}

return result;

}

};

}

});

On Fri, Oct 17, 2014 at 4:28 PM, Wayne W <wa...@gmail.com>
wrote:

> Hi Sven,
>
> We don't set the RenderStrategy so we should (in wicket 6) be using this
> default strategy.
>
> Any other idea?
>
> On Thu, Oct 16, 2014 at 8:28 PM, Sven Meier <sv...@meiers.net> wrote:
>
>> Hi,
>>
>> what RenderStrategy are you using?
>>
>> WIth REDIRECT_TO_BUFFER Wicket should send a redirect to the search
>> results page after your form's submit.
>>
>> Sven
>>
>>
>> On 10/16/2014 07:16 PM, Wayne W wrote:
>>
>>> Hi,
>>>
>>> we have a simple search form:
>>>
>>> Form<String> form = new Form<String>("searchForm") {
>>>
>>> @Override
>>>
>>> protected void onSubmit() {
>>>
>>> PageParameters params = new PageParameters();
>>>
>>> params.add("0", search);
>>>
>>> setResponsePage(SearchResultsPage.class, params);
>>>
>>> }
>>>
>>>
>>>   };
>>>
>>>
>>> This displays a list of results with each row having a
>>> BookmarkablePageLink
>>> to another page. If the user uses the form , the results are displayed.
>>> Then they click on any of the links they are taken to the next page.
>>>
>>>
>>> However when they click 'Back' on the browser they always get 'Confirm
>>> Form
>>> Resubmission' in Chrome, 'Document Expired' in Firefox etc. How can we
>>> stop
>>> this and just display the result page?
>>>
>>>
>>> What I actually see in the URLs is:
>>>
>>> server.com/searchFormPage
>>>
>>> server.com?34-1.IFormSubmitListener-baseCont-search-searchForm
>>>
>>> server.com/specificPage/842978
>>>
>>> Then they click on back and you get
>>>
>>> server.com?34-1.IFormSubmitListener-baseCont-search-searchForm
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

Re: Anyway of stopping this?

Posted by Wayne W <wa...@gmail.com>.
Hi Sven,

We don't set the RenderStrategy so we should (in wicket 6) be using this
default strategy.

Any other idea?

On Thu, Oct 16, 2014 at 8:28 PM, Sven Meier <sv...@meiers.net> wrote:

> Hi,
>
> what RenderStrategy are you using?
>
> WIth REDIRECT_TO_BUFFER Wicket should send a redirect to the search
> results page after your form's submit.
>
> Sven
>
>
> On 10/16/2014 07:16 PM, Wayne W wrote:
>
>> Hi,
>>
>> we have a simple search form:
>>
>> Form<String> form = new Form<String>("searchForm") {
>>
>> @Override
>>
>> protected void onSubmit() {
>>
>> PageParameters params = new PageParameters();
>>
>> params.add("0", search);
>>
>> setResponsePage(SearchResultsPage.class, params);
>>
>> }
>>
>>
>>   };
>>
>>
>> This displays a list of results with each row having a
>> BookmarkablePageLink
>> to another page. If the user uses the form , the results are displayed.
>> Then they click on any of the links they are taken to the next page.
>>
>>
>> However when they click 'Back' on the browser they always get 'Confirm
>> Form
>> Resubmission' in Chrome, 'Document Expired' in Firefox etc. How can we
>> stop
>> this and just display the result page?
>>
>>
>> What I actually see in the URLs is:
>>
>> server.com/searchFormPage
>>
>> server.com?34-1.IFormSubmitListener-baseCont-search-searchForm
>>
>> server.com/specificPage/842978
>>
>> Then they click on back and you get
>>
>> server.com?34-1.IFormSubmitListener-baseCont-search-searchForm
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Anyway of stopping this?

Posted by Sven Meier <sv...@meiers.net>.
Hi,

what RenderStrategy are you using?

WIth REDIRECT_TO_BUFFER Wicket should send a redirect to the search 
results page after your form's submit.

Sven

On 10/16/2014 07:16 PM, Wayne W wrote:
> Hi,
>
> we have a simple search form:
>
> Form<String> form = new Form<String>("searchForm") {
>
> @Override
>
> protected void onSubmit() {
>
> PageParameters params = new PageParameters();
>
> params.add("0", search);
>
> setResponsePage(SearchResultsPage.class, params);
>
> }
>
>
>   };
>
>
> This displays a list of results with each row having a BookmarkablePageLink
> to another page. If the user uses the form , the results are displayed.
> Then they click on any of the links they are taken to the next page.
>
>
> However when they click 'Back' on the browser they always get 'Confirm Form
> Resubmission' in Chrome, 'Document Expired' in Firefox etc. How can we stop
> this and just display the result page?
>
>
> What I actually see in the URLs is:
>
> server.com/searchFormPage
>
> server.com?34-1.IFormSubmitListener-baseCont-search-searchForm
>
> server.com/specificPage/842978
>
> Then they click on back and you get
>
> server.com?34-1.IFormSubmitListener-baseCont-search-searchForm
>


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