tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damian Sobieralski" <dsobi...@asu.edu>
Subject RE: Newbie and form submission (rewinding resetting values)
Date Fri, 02 Mar 2007 03:58:08 GMT
Nick,

 Thank you!! That did the trick.

 Granted, I am new to this so this might be an asinine question - but
why do I have to "set up" the form to be re-displayed on a validation
error?  I mean, when would one rewind after a validation and NOT want
the form values pre-filled in with their previously submitted values?
Shouldn't that be the natural/default behavior and I'd only "overrule"
this behavior if I had a reason?

 I understand that this is the way it works. I guess I'm just wondering
why it was designed this way (probably something very reasonable that I
am not aware of)?

 Anyways, this was most frustrating. But upto this point I was having
fun with Tapestry.  So I can continue on with the learning.

Thanks again for scooting me on my way in the adventure!

- Damian


> -----Original Message-----
> From: Nick Westgate [mailto:nick@key-planning.co.jp]
> Sent: Thursday, March 01, 2007 8:35 PM
> To: Tapestry users
> Subject: Re: Newbie and form submission (rewinding resetting values)
> 
> Hi Damian.
> 
> You need to add something like this here:
> +       @Persist
> > 	public abstract Person getPerson();
> 
> Otherwise the Person is not persisted between cycles.
> That's what's causing your current exception.
> 
> Also, you don't want to overwrite changes made to Person
> by the user, so you should add something here too:
> >     public void pageBeginRender(PageEvent event)
> >     {
> >     	 if (! event.getRequestCycle().isRewinding())
> >     	 {
> +            if (getPerson() == null)
> >     	        setPerson(new Person());
> >        }
> 
> Cheers,
> Nick.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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


Mime
View raw message