You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ryan <wi...@mandrake.us> on 2008/03/12 17:06:30 UTC

Panel state when created from GridView

I have a panel that contains a boolean property to track its state
(editMode). I have a page that creates several of these panels by using
a GridView, which gets the model from the datasource and passes it to
the panels constructor.

The panel has a Link and its onclick just toggles the editMode boolean.
I am not using AJAX, so naturally the page refreshes when the link is
clicked. When the page refreshes, new instances of the panels are
recreated, thus losing the setting of the editMode member variable.

I can make the page track the editMode of each panel in various ways,
but I was wondering if there is a better way?

Thanks!
Ryan

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


Re: Panel state when created from GridView

Posted by Igor Vaynberg <ig...@gmail.com>.
that is already fixed in the upcoming 1.3.2

-igor


On Wed, Mar 12, 2008 at 5:08 PM, Ryan <wi...@mandrake.us> wrote:
> On Wed, Mar 12, 2008 at 10:03:28AM -0700, Igor Vaynberg exclaimed:
>
>
>  >see setitemreusestrategy() on the gridpanel
>  >
>  >-igor
>  >
>  >
>  >On Wed, Mar 12, 2008 at 9:06 AM, Ryan <wi...@mandrake.us> wrote:
>  >> I have a panel that contains a boolean property to track its state
>  >>  (editMode). I have a page that creates several of these panels by using
>  >>  a GridView, which gets the model from the datasource and passes it to
>  >>  the panels constructor.
>  >>
>  >>  The panel has a Link and its onclick just toggles the editMode boolean.
>  >>  I am not using AJAX, so naturally the page refreshes when the link is
>  >>  clicked. When the page refreshes, new instances of the panels are
>  >>  recreated, thus losing the setting of the editMode member variable.
>  >>
>  >>  I can make the page track the editMode of each panel in various ways,
>  >>  but I was wondering if there is a better way?
>  >>
>  >>  Thanks!
>  >>  Ryan
>
>
>  Igor,
>
>  Thanks for you help, I found a great example in WiA. I did find a bug in
>  GridView, and created a JIRA issue (WICKET-1419).
>
>  Thanks again,
>  -Ryan
>
>
>
>  ---------------------------------------------------------------------
>  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: Panel state when created from GridView

Posted by Ryan <wi...@mandrake.us>.
On Wed, Mar 12, 2008 at 10:03:28AM -0700, Igor Vaynberg exclaimed:

>see setitemreusestrategy() on the gridpanel
>
>-igor
>
>
>On Wed, Mar 12, 2008 at 9:06 AM, Ryan <wi...@mandrake.us> wrote:
>> I have a panel that contains a boolean property to track its state
>>  (editMode). I have a page that creates several of these panels by using
>>  a GridView, which gets the model from the datasource and passes it to
>>  the panels constructor.
>>
>>  The panel has a Link and its onclick just toggles the editMode boolean.
>>  I am not using AJAX, so naturally the page refreshes when the link is
>>  clicked. When the page refreshes, new instances of the panels are
>>  recreated, thus losing the setting of the editMode member variable.
>>
>>  I can make the page track the editMode of each panel in various ways,
>>  but I was wondering if there is a better way?
>>
>>  Thanks!
>>  Ryan


Igor,

Thanks for you help, I found a great example in WiA. I did find a bug in
GridView, and created a JIRA issue (WICKET-1419). 

Thanks again,
-Ryan

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


Re: Panel state when created from GridView

Posted by Igor Vaynberg <ig...@gmail.com>.
see setitemreusestrategy() on the gridpanel

-igor


On Wed, Mar 12, 2008 at 9:06 AM, Ryan <wi...@mandrake.us> wrote:
> I have a panel that contains a boolean property to track its state
>  (editMode). I have a page that creates several of these panels by using
>  a GridView, which gets the model from the datasource and passes it to
>  the panels constructor.
>
>  The panel has a Link and its onclick just toggles the editMode boolean.
>  I am not using AJAX, so naturally the page refreshes when the link is
>  clicked. When the page refreshes, new instances of the panels are
>  recreated, thus losing the setting of the editMode member variable.
>
>  I can make the page track the editMode of each panel in various ways,
>  but I was wondering if there is a better way?
>
>  Thanks!
>  Ryan
>
>  ---------------------------------------------------------------------
>  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