Makes perfect sense, thanks for the suggestion Geoff.

On Tue, Oct 14, 2014 at 9:20 PM, Geoff Callender <
geoff.callender.jumpst...@gmail.com> wrote:

> IMHO, I think it's helpful to indicate when and why you're instantiating
> UserProfile, rather than just conditioning by "is null".
>
>     void onPrepareForRender() throws Exception {
>
>         // If fresh start, make sure there's a UserProfile object
> available.
>
>         if (form.isValid()) {
>             person = new UserProfile();
>         }
>     }
>
>     void onPrepareForSubmit() throws Exception {
>         // Instantiate a UserProfile for the form data to overlay.
>         person = new UserProfile();
>     }
> Just my two cents worth.
>
> On 15 Oct 2014, at 2:39 am, George Christman <gchrist...@cardaddy.com>
> wrote:
>
> > Yup, that's exactly what was happening.
> >
> > On Tue, Oct 14, 2014 at 11:35 AM, Lance Java <lance.j...@googlemail.com>
> > wrote:
> >
> >> This makes sense. For validation errors, tapestry does NOT
> >> redirect-after-post so the POST request is the same as the render
> request.
> >> I can only assume that onPrepare() is called twice in the same request
> in
> >> the case of validation errors so your null check stops the POST values
> from
> >> being overridden.
> >>
> >
> >
> >
> > --
> > George Christman
> > www.CarDaddy.com
> > P.O. Box 735
> > Johnstown, New York
>
>


-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Reply via email to