wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject Re: Passing IModel in Constructor of bookmarkable Page?
Date Mon, 21 Jan 2013 08:57:19 GMT
You can pass the oldPageId as a request parameter too. Then use it: new
PageReference(oldPageId.toInt()).getPage()


On Mon, Jan 21, 2013 at 10:39 AM, Bernard <bht237@gmail.com> wrote:

> Hi Martin,
>
> Thanks for the advice. So I will use PageParameters then and let
> Wicket construct the page.
>
> But:
>
> I also have page constructors with PageReference parameter to link
> back to. This would break bookmarkable as well. Would you have similar
> concerns about PageReference?
>
> Kind Regards,
>
> Bernard
>
>
> On Mon, 21 Jan 2013 10:05:57 +0200, you wrote:
>
> >Hi,
> >
> >I think using Page#Page(IModel) constructor is not very useful. It appears
> >to be anti-pattern lately.
> >There were several tickets related to ModalWindow when a model is shared
> >between the page that contains the modal and the page inside the modal.
> The
> >two different pages are being serialized with different state of the model
> >and after deserialization this model is no more the same instance anymore
> >and the benefit of sharing a model is no more there.
> >
> >If you still want to go the way you want then check IPageFactory and its
> >default impl - DefaultPageFactory.
> >
> >
> >
> >On Mon, Jan 21, 2013 at 3:45 AM, Bernard <bht237@gmail.com> wrote:
> >
> >> Hi all
> >>
> >> I am searching for a robust pattern to work around
> >> PageExpiredException.
> >>
> >> My first idea was to have all pages bookmarkable and rely on
> >>
> >>
> org.apache.wicket.settings.IPageSettings#getRecreateMountedPagesAfterExpiry()
> >> to recover.
> >>
> >> But this breaks when passing IModel in page constructors because then
> >> pages are no longer bookmarkable.
> >>
> >> Of course avoiding the constructor and letting Wicket create the page
> >> with PageParameters would solve this problem but I want to avoid this.
> >>
> >> It would be very useful to pass an IModel to a bookmarkable Page. How
> >> can this be done?
> >>
> >> I am trying to avoid expiring logout links (the primary driver of all
> >> this). In case of page expiry I can deal with the exceptional call of
> >> the default constructor from
> >> IPageSettings#getRecreateMountedPagesAfterExpiry() by responding with
> >> a bookmarkable page.
> >>
> >> Many thanks,
> >>
> >> Bernard
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message