Hi,

On Thu, Jul 19, 2018 at 6:25 PM Entropy <blmulholl...@gmail.com> wrote:

> I definitely need more info on the 2nd and 3rd items in your list.  My
> designer is bugging me multiple times a day trying to get this answer.  You
> said:
>
> > - you can run into problems when the same page is rendered in two
> > different browser tabs, use AjaxNewWindowNotifyingBehavior to detect
> this
>
> What kind of problems are we talking about, and what would I do in that
> behavior to counteract them, because showing the same page (albeit
> different
> record) in different browser tabs definitely is the design he's pushing
> for.
>

If you (as a user) try to work with the same page *instance* (i.e. same
page id in the url) in more
than one tabs then you may face StalePageException.
Each page instance has a member field 'renderCount'. Its value is encoded
in the component urls,
e.g. ...?22-1.SomeLink
Here '22' is the page id and '1' is the render count.
If you click this (non-Ajax) link then it will do something in its
#onClick() method and will repaint
the same page instance with its new state (modified in onClick()). The
repainting will increment 'renderCount' to 2.
Now if you try to use page with id 22 in another tab, where the renderCount
is still 1 in the component urls,
Wicket will throw StalePageException, telling you that you try to use old
state of a page.
AjaxNewWindowNotifyingBehavior could help you to detect when the same page
instance is opened in more than one
tabs/windows. The simplest thing you can do is:
setResponsePage(getPageClass(), getPageParameters()).
This effectively will render a new instance of the current page, i.e. it
will have its own page id (like 23) and its own renderCount.
Beware that this will solve the issue with StalePageException but may move
it to your business layer.
For example if the link above removes a record in the DB. Then when you
move to tab2 and try to edit the removed record
your DB layer will fail with something like "No such record error".


>
> - working on different tabs might lead to pages being expelled from the
> page store, see StoreSettings#maxSizePerSession
>
> And what would be the consequences of it being expelled?  User gets an
> error?  Can we close the window in response to that error?  Maybe with a
> message telling them the page expired and they need to re-open it?  Or
> maybe
> we could re-open it for them?
>
> --
> Sent from:
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to