Just noticed your constructor. Don't do that. The Person object that you create will become the default value for this property, rather than null. This is documented.
On 5/30/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
There should not be any difference; I'd have to see your code to determine what's going on. On 5/30/07, Martin Dietze < [EMAIL PROTECTED]> wrote: > > On Wed, May 30, 2007, Howard Lewis Ship wrote: > > > >I have a page class which keeps form data like this: > > > > > >| // class MyForm > > >| private Person _person; > > >| private String _homepage; > > > > > >The class Person consists of several fields: > > > > > >| // class Person > > >| private String _firstName > > >| private String _lastName > > > > > >For all these I have getters and setters defined. > > > > > >In my page class I have a constructor like this: > > > > > >| public CreatePartner() { > > >| _contact = new Person(); > ^^^^^^^ `person' of course! > > >| } > > [...] > > > Tapestry uses a redirect-after-post for actions, including form > submits. > > Thus if the data is stored persistently, usually in the HttpSession, > it is > > gone on the second request, the one that actually renders a response. > > > If you used the debugger, you'd see that your _person field would also > be > > null in the second request, the render request. You just aren't using > it. > > Interestingly this does not seem to be the case in my > application. Debugging the above class I find that when the > page is rendered after submit the `Person' object still > contains the submitted values. > > Additionally `_$person_default' object (as I guess created by > T5) contains the values of the populated person object. > > For the `_homeapage' object which is an ordinary String, the > values are lost unless I put a [EMAIL PROTECTED]("flash")' above it > which should be expected according to your post. Now I wonder > why does the Person object seem to behave differently? > > Cheers, > > Martin > > -- > ------------- / http://herbert.the-little-red-haired-girl.org / > ------------- > =+= > The only "intuitive" interface is the nipple. After that, it's all > learned. -- Bruce Ediger > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com
-- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com