Re: Validation question - at which point are property values set before post

2009-10-07 Thread Peter Stavrinides
Thanks for the explanations, much appreciated to all.

Peter

- Original Message -
From: "cordenier christophe" 
To: "Tapestry users" 
Sent: Wednesday, 7 October, 2009 15:07:52 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: Validation question - at which point are property values set  
before post

Hi

The solutions suggested by Dirk and Urlich sounds good to me.

Actually, in the submission process the target variable set with 'value'
attribute is modified only if validation succeeds. This is why your code
doesn't work.

Christophe.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Validation question - at which point are property values set before post

2009-10-07 Thread cordenier christophe
Hi

The solutions suggested by Dirk and Urlich sounds good to me.

Actually, in the submission process the target variable set with 'value'
attribute is modified only if validation succeeds. This is why your code
doesn't work.

Christophe.


Re: Validation question - at which point are property values set before post

2009-10-07 Thread Peter Stavrinides
Anybody?

- Original Message -
From: "Peter Stavrinides" 
To: "Tapestry Mailing List" 
Sent: Tuesday, 6 October, 2009 10:07:53 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Validation question - at which point are property values set before 
post

Hi everyone,

I came across what seems a strange scenario to me, using Tapestry 5 validation. 
I am looking for a little understanding more than anything else with regards to 
'the point at which properties values are set, before a form posts'...  please 
examine this code snippet:

//This code works
public void onSuccess() throws SQLException {

if(isTerminated()){
if(personnelData.getEndDate() == null){  
employeeform.recordError("End date is 
required");
return;
}
}
...
}

//And this code doesn't because the property personnelData.getEndDate() appears 
to not have been set yet!

void onValidateFromEndDate(){
if(isTerminated()){
if(personnelData.getEndDate() == null){
employeeform.recordError("End date is required");
}
}
}

personnelData.getEndDate() evaluates to a date in the onSuccess() method, but 
in the onValidateFromEndDate validator it is null?? the component in question 
is a datepicker, so the value is set via JavaScript. I am wandering why 
Tapestry doesn't pick up the value change until the onSuccess() event triggers.

Thanks,
Peter

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org