You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Joshua Jackson <jo...@gmail.com> on 2007/11/26 08:07:43 UTC

Stateless Form

Dear all,

I've made a Page with the usual Form component. The use case is users
are able to enter data from this form more than once when they are
still on that page. But the problem is the state of the object from
that form is kept, so it looks like that user enters the same data.

So I tried using StatelessForm and it worked. But is there anything
I've sacrificed if I use StatelessForm? And is there any other way so
the state from the form is not kept other than using StatelessForm?

Thanks in advance.

-- 
What you want today, may not exist tommorrow

Blog: http://joshuajava.wordpress.com/

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


Re: Stateless Form

Posted by Johan Compagner <jc...@gmail.com>.
If you use a stateless form then the complete page is recreated when
the user does a submit, the plus is then that you never have an
expired page and for you that you start fresh. But that starting fresh
is only because you page is fully stateless, if you had some other
none stateless thing on it (link, ajax behavior). Then you still had
the same problem, because the page is reused.

What you should do in that case is set the backing object/model to a
new object again in the submit method. so use a compound property
model on your form with a bean and set a new bean in the model

On 11/26/07, Joshua Jackson <jo...@gmail.com> wrote:
> Dear all,
>
> I've made a Page with the usual Form component. The use case is users
> are able to enter data from this form more than once when they are
> still on that page. But the problem is the state of the object from
> that form is kept, so it looks like that user enters the same data.
>
> So I tried using StatelessForm and it worked. But is there anything
> I've sacrificed if I use StatelessForm? And is there any other way so
> the state from the form is not kept other than using StatelessForm?
>
> Thanks in advance.
>
> --
> What you want today, may not exist tommorrow
>
> Blog: http://joshuajava.wordpress.com/
>
> ---------------------------------------------------------------------
> 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