The default value that the _person member gets reset to will be 
the Person _instance_ that you assigned in the constructor.

So when the form is submitted that instance will have its members
set based on the form values.  When the page is rendered the 
same instance will be used as the default value & you will see
your submitted values.

Basically default values only work properly when they are immutable.
e.g. strings, 

For a form I'd say the best place to create those compound objects
is in the onPrepare method.  This will be invoked before any processing/
rendering occurs.  (see the Form component subsection of 
http://tapestry.apache.org/tapestry5/tapestry-core/guide/validation.html)

Another option is the pageAttached method (invoked when page
is attached to the request) which is documented at
http://tapestry.apache.org/tapestry5/tapestry-core/guide/lifecycle.html

cheers,
Ben


> 
> This is strange. If the _person member variable gets reset to
> the default at the end of each request I would expect not to
> see the values from it on my page after submit in the render
> request.
> 
> What I want to achieve is very much the same scenario found in
> the documentation section "Form Input and Validation", only I
> have several compound objects like `Person'. Since the form
> accesses members of these objects they need to be created in
> the page class. Since the constructor is obviously not the
> right place for this, which one would you suggest?
> 
> Cheers,
> 
> Martin
> 
> -- 
> ----------- / http://herbert.the-little-red-haired-girl.org / 
> -------------
> =+= 
> Was ist ein Cluster?
> Wenn vier Bratscher unisono spielen.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to