You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Lorenzo Bolzani <l....@gmail.com> on 2009/05/22 13:46:50 UTC

How to keep fields between pages

Hi, I'm trying to keep a page state between requests.

I know this should be a very simple thing, but it's puzzling me.

I have a field, a List, in my page where some data from the user is
accumulated. This data is generated from a "monitoring" system.

The user starts the monitoring and the events are added to the list.
Then he need to be able to move to other pages, do some other stuff,
than come back to this page and find the previous content (for example
the last 100 events).

I use a ListView to display the data.

So I think the Page should be instantiated only once, but the populate
item should be called on every page display. Even browser refresh
should not create a new Page.

Then the page should auto refresh with an ajaxSelfUpdate behaviour,
html refresh or something like that.

At this time I'm fighting with mounts, PageLinks and populateItems but
I'm not finding the right combo.

Is this approach correct? Should I use something else instead of a
field to keep the data?


Thanks, bye

Lorenzo

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


Re: How to keep fields between pages

Posted by Igor Vaynberg <ig...@gmail.com>.
conversation scope in wicket is simply passing this data from page to
page. eg setresponsepage(new step2page(data));

-igor

On Fri, May 22, 2009 at 5:53 PM, janneru <ja...@googlemail.com> wrote:
> i wouldn't be happy to put such data into the session where it will lie
> around all the time; it doesnt belong to the user but to a usecase which
> consists of just some pages; a perfect application for conversation scope;
> when you use wicket with seam, seam can handle these conversation scopes for
> you.
>
> cheers, uwe!
>
> On Sat, May 23, 2009 at 12:36 AM, Jeremy Thomerson <
> jeremy@wickettraining.com> wrote:
>
>> I would suggest that this would be the "wicket way" as well.  This
>> sounds like the data is session scoped - it belongs to the user.  It
>> doesn't really "belong" to a page.  Just OO.
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>>
>> On Fri, May 22, 2009 at 7:40 AM, Lorenzo Bolzani <l....@gmail.com>
>> wrote:
>> > Yes, I can, but it doesn't look very "wicket style",
>>
>> ---------------------------------------------------------------------
>> 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


Re: How to keep fields between pages

Posted by janneru <ja...@googlemail.com>.
i wouldn't be happy to put such data into the session where it will lie
around all the time; it doesnt belong to the user but to a usecase which
consists of just some pages; a perfect application for conversation scope;
when you use wicket with seam, seam can handle these conversation scopes for
you.

cheers, uwe!

On Sat, May 23, 2009 at 12:36 AM, Jeremy Thomerson <
jeremy@wickettraining.com> wrote:

> I would suggest that this would be the "wicket way" as well.  This
> sounds like the data is session scoped - it belongs to the user.  It
> doesn't really "belong" to a page.  Just OO.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Fri, May 22, 2009 at 7:40 AM, Lorenzo Bolzani <l....@gmail.com>
> wrote:
> > Yes, I can, but it doesn't look very "wicket style",
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to keep fields between pages

Posted by Jeremy Thomerson <je...@wickettraining.com>.
I would suggest that this would be the "wicket way" as well.  This
sounds like the data is session scoped - it belongs to the user.  It
doesn't really "belong" to a page.  Just OO.

--
Jeremy Thomerson
http://www.wickettraining.com




On Fri, May 22, 2009 at 7:40 AM, Lorenzo Bolzani <l....@gmail.com> wrote:
> Yes, I can, but it doesn't look very "wicket style",

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


Re: How to keep fields between pages

Posted by Lorenzo Bolzani <l....@gmail.com>.
2009/5/22 Dipu <di...@googlemail.com>:
> can't you store the List in the session when you move to other page's
> and get it from session when you get back.
>

Yes, I can, but it doesn't look very "wicket style", so I suspect I'm
missing something about Wicket (PageMaps, RequestTarget, ecc.) and
that there is a very clean and easy solution waiting out there.

If it's not so, using session attributes could be a good option.


Thanks

Lorenzo

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


Re: How to keep fields between pages

Posted by Dipu <di...@googlemail.com>.
can't you store the List in the session when you move to other page's
and get it from session when you get back.

-dipu

On Fri, May 22, 2009 at 12:46 PM, Lorenzo Bolzani <l....@gmail.com> wrote:
> Hi, I'm trying to keep a page state between requests.
>
> I know this should be a very simple thing, but it's puzzling me.
>
> I have a field, a List, in my page where some data from the user is
> accumulated. This data is generated from a "monitoring" system.
>
> The user starts the monitoring and the events are added to the list.
> Then he need to be able to move to other pages, do some other stuff,
> than come back to this page and find the previous content (for example
> the last 100 events).
>
> I use a ListView to display the data.
>
> So I think the Page should be instantiated only once, but the populate
> item should be called on every page display. Even browser refresh
> should not create a new Page.
>
> Then the page should auto refresh with an ajaxSelfUpdate behaviour,
> html refresh or something like that.
>
> At this time I'm fighting with mounts, PageLinks and populateItems but
> I'm not finding the right combo.
>
> Is this approach correct? Should I use something else instead of a
> field to keep the data?
>
>
> Thanks, bye
>
> Lorenzo
>
> ---------------------------------------------------------------------
> 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