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