You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Nelson Segura <ns...@gmail.com> on 2011/09/13 01:02:13 UTC

Storing component state information in session

Hello,

Our app has several components that "retain" their state during a user
session. Examples like:

1. Number of results per page in a pageable component.
2. State of a collapsible container.
3. Which tab is selected in a tabbed panel.

In old JSP world this will be tracked in the user session as an
attribute with the page name + the component id. This attribute has a
default value if not present.
What is the recommended way to handle this in the new Wicket World?
Does anyone have any experience handle similar problems? I was
planning to integrate this in the components themselves so they would
be transparent to the developer using the components. (Still using
wicket 1.4.x)

-Nelson Segura

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


Re: Storing component state information in session

Posted by Igor Vaynberg <ig...@gmail.com>.
use session's metadata facility to store the state. if you have a lot
of these components you can store a map<key,value> under a single
metadata key, just remember to make that code threadsafe.

-igor


On Mon, Sep 12, 2011 at 4:02 PM, Nelson Segura <ns...@gmail.com> wrote:
> Hello,
>
> Our app has several components that "retain" their state during a user
> session. Examples like:
>
> 1. Number of results per page in a pageable component.
> 2. State of a collapsible container.
> 3. Which tab is selected in a tabbed panel.
>
> In old JSP world this will be tracked in the user session as an
> attribute with the page name + the component id. This attribute has a
> default value if not present.
> What is the recommended way to handle this in the new Wicket World?
> Does anyone have any experience handle similar problems? I was
> planning to integrate this in the components themselves so they would
> be transparent to the developer using the components. (Still using
> wicket 1.4.x)
>
> -Nelson Segura
>
> ---------------------------------------------------------------------
> 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