tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Westgate <n...@key-planning.co.jp>
Subject Re: Newbie and form submission (rewinding resetting values)
Date Fri, 02 Mar 2007 03:34:38 GMT
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


Mime
View raw message