You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sergey Olefir <so...@gmail.com> on 2010/03/25 14:00:56 UTC

Support for back button and new windows?

Hi,

I'm looking for a good source of information on Wicket's support for
browser's back button and also on what happens when user opens a new
tab/window. I feel this is something I need to understand well before
we can deploy our first Wicket application in production.

I found this:
http://cwiki.apache.org/WICKET/browser-back-forward.html
But this is rather old page, so I'm not sure it's still accurate.
Furthermore after reading that page I'm still unsure what it all
implies.

For example, regarding 'back button' support, after a little
experimentation it seems as if Wicket serializes/stores each page it
generates -- including all the data involved. E.g. if I have
multi-page wizard that stores all data in a single object, and if I
fill pages 1 & 2 (and I'm currently at page 3), but then use browser's
'back' button to go to page 1 and submit that -- I'll get empty page 2
-- with all the data I've entered previously 'forgotten'. That seems
to strongly imply data serialization.

So what actually happens when browser's back button is used?


And similarly -- what happens when user opens new tab/window in the
middle of the wizard? Does user then get two completely separate
wizard forms that can be changed/submitted separately? Or something
else?


Thanks in advance!

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


Re: Support for back button and new windows?

Posted by Sergey Olefir <so...@gmail.com>.
Hi,

thanks for the reply :)

Some comments: 
- very hacky way is not appropriate (I think) as it'll break clustering,
session persistence (server restart), etc.

- less hacky: that's something I've been thinking about. But I'd need more
specific information to go that way -- how to determine exactly what to
expire from the page store, how to distinguish page expired vs. session
expired situations, how to redirect user back to the 'last valid page' they
were on (before they tried to (ab)use browser's back button)? Any particular
suggestions?

- even less hacky: I'm not 100% positive what exactly is that you're
suggesting, but I do have a question -- could it possibly work? In my
experiments with Wicket and browser's back button, Wicket seems to
demonstrate a miraculous capability of restoring state as it was at the
point of time when that particular page was rendered -- that's including
both stuff that is in the model and also in instance variables in page
instances. I really need to somehow understand how this back support works
-- I'm rather scared that my lack of understanding will lead to some rather
unexpected and unpleasant failures in production. Any suggestions as to
where to look for info?



Martijn Dashorst wrote:
> 
> A couple of thoughts come to mind:
>  - very hacky: ensure the wizard pages are not serializable -> they
> won't end up in the pagestore so any back button activity will result
> in pageexpired messages
>  - less hacky: remove the wizard pages after the final submission from
> the pagestore (I believe you can evict them)
>  - even less hacky: in onsubmit of your final step mark the form
> submitted (create a field 'submitted' and set it to true) and add a
> validator that fails when the flag is true
> 
> Martijn
> 
> On Fri, Mar 26, 2010 at 4:48 PM, Sergey Olefir <so...@gmail.com>
> wrote:
>>
>> Also on this subject -- if I want to prevent users from submitting wizard
>> (multi-page form) again via back button after they've submitted it once
>> (or
>> in other conditions), what would be the best way to approach this
>> problem?
>>
>> And similarly -- if I want to prevent users from using back button at all
>> (e.g. show them the last 'normally' generated page if they submit
>> anything
>> from the 'old' page), what would be the best way to achieve this?
> 
> 

-- 
View this message in context: http://old.nabble.com/Support-for-back-button-and-new-windows--tp28028525p28080646.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Support for back button and new windows?

Posted by Martijn Dashorst <ma...@gmail.com>.
A couple of thoughts come to mind:
 - very hacky: ensure the wizard pages are not serializable -> they
won't end up in the pagestore so any back button activity will result
in pageexpired messages
 - less hacky: remove the wizard pages after the final submission from
the pagestore (I believe you can evict them)
 - even less hacky: in onsubmit of your final step mark the form
submitted (create a field 'submitted' and set it to true) and add a
validator that fails when the flag is true

Martijn

On Fri, Mar 26, 2010 at 4:48 PM, Sergey Olefir <so...@gmail.com> wrote:
>
> Also on this subject -- if I want to prevent users from submitting wizard
> (multi-page form) again via back button after they've submitted it once (or
> in other conditions), what would be the best way to approach this problem?
>
> And similarly -- if I want to prevent users from using back button at all
> (e.g. show them the last 'normally' generated page if they submit anything
> from the 'old' page), what would be the best way to achieve this?
>
>
>
> Sergey Olefir wrote:
>>
>> Hi,
>>
>> I'm looking for a good source of information on Wicket's support for
>> browser's back button and also on what happens when user opens a new
>> tab/window. I feel this is something I need to understand well before
>> we can deploy our first Wicket application in production.
>>
>
> --
> View this message in context: http://old.nabble.com/Support-for-back-button-and-new-windows--tp28028525p28043507.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.4

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


Re: Support for back button and new windows?

Posted by Sergey Olefir <so...@gmail.com>.
Also on this subject -- if I want to prevent users from submitting wizard
(multi-page form) again via back button after they've submitted it once (or
in other conditions), what would be the best way to approach this problem?

And similarly -- if I want to prevent users from using back button at all
(e.g. show them the last 'normally' generated page if they submit anything
from the 'old' page), what would be the best way to achieve this?



Sergey Olefir wrote:
> 
> Hi,
> 
> I'm looking for a good source of information on Wicket's support for
> browser's back button and also on what happens when user opens a new
> tab/window. I feel this is something I need to understand well before
> we can deploy our first Wicket application in production.
> 

-- 
View this message in context: http://old.nabble.com/Support-for-back-button-and-new-windows--tp28028525p28043507.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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