Re: Ajax form not holding onto field values after validation error.

2014-10-15 Thread George Christman
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 o

Re: Ajax form not holding onto field values after validation error.

2014-10-14 Thread Geoff Callender
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()) {

Re: Ajax form not holding onto field values after validation error.

2014-10-14 Thread George Christman
Yup, that's exactly what was happening. On Tue, Oct 14, 2014 at 11:35 AM, Lance Java 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 r

Re: Ajax form not holding onto field values after validation error.

2014-10-14 Thread Lance Java
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 overridde

Re: Ajax form not holding onto field values after validation error.

2014-10-13 Thread George Christman
figured it out, was an error on my behalf. I needed to wrap new UserProfile with a null check. public void onPrepareFromRegisterForm() { if (userProfile == null) { userProfile = new UserProfile(); userProfile.setCreateDate(new Date()); } } On Mon, Oct 1

Re: Ajax form not holding onto field values after validation error.

2014-10-13 Thread George Christman
So I think I'm close to figuring out the cause of this issue, it looks as if the form/field id's are changing with the zone up date which I believe is the cause of this issue. Any experts have any thoughts? On Mon, Oct 13, 2014 at 3:01 PM, George Christman wrote: > Odd behavior, I found if I remo

Re: Ajax form not holding onto field values after validation error.

2014-10-13 Thread George Christman
Odd behavior, I found if I removed the form from the zone it fixed the issue; however this does not make any sense to me though. //additional fields On Mon, Oct 13, 2014 at 1:43 PM, George Christman wrote: > I'm using 5.4 and for some reason I can not get my ajax form to hold > onto the fi

Ajax form not holding onto field values after validation error.

2014-10-13 Thread George Christman
I'm using 5.4 and for some reason I can not get my ajax form to hold onto the field values after a validation error has occurred. When a validation error occures all my fields are blanked out. Does anybody have any idea what might be causing this? I have the following code snippet. //additiona