On Mar 28, 2010, at 9:10 AM, Ricardo Aráoz wrote:

> The field turns red and black correctly on field validation, and it's
> exactly what I wanted. But if I leave the wrong value and click on the
> save button the record is not saved (that's correct) but no error
> message from the record validation is displayed. On the basis that field
> and record validation should be orthogonal I think there's something wrong.
> I know it is the code run by the field validator because when I comment
> out the validateField() method of 'recipes.py' then the error window
> comes up as it should.

        These events happen in sequence, and once a failure happens, the 
process is stopped. Think of it this way: we know that the current field is not 
valid, so why bother continuing to see if anything else is valid? The record 
cannot be saved as it exists.

        If the current field fails validation, the save process will stop then. 
Normally a message is displayed in the status bar to inform the user of that 
fact, but you've chosen to suppress that behavior.

        What I think you're trying to do is not say that the field is invalid, 
but that the record with the field in that state is invalid. So perhaps try 
moving your onFieldValidationFailed() code to the onLostFocus() event handler 
for that control. This way you get the coloring you want without disrupting the 
process, and when you run save(), the validateRecord() code will catch the 
problem and display the normal error message.


-- Ed Leafe



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to