Reputation: 1952
I'm developing adf calendar events form where the main page displays the calendar when user click on any date a small form appears to enter event details. I did most of the work but I'm facing a validation problem, I want when user save the form it checks if a field has a value and contains a number other than zero to save the form to the database if it has a zero it displays an error message, I hope you got the idea.
Note: I set ActionListener = #{bindings.Commit.execute} to the save button, I'm wondering if I can execute the validation when execute commit.
Regards,
Upvotes: 0
Views: 669
Reputation: 711
create an IMPL file and override DoDML. You can then decide whether or not to update the database with the change. For a similar sample, see
http://docs.oracle.com/cd/E23943_01/web.1111/b31974/bcadveo.htm#CEGIBHBC
From the entity impl you have access to its attribute for your 0, 1 comparison
Upvotes: 1
Reputation: 21
You can. The those validation should be added to the entity object. Generate it as Java with all accessors and so on. In that class you can add validators.
If you want you can add a backing bean and a value change listener to the ADF component and do some checks there as well.
But the common consent is that pre-commit validations should be added to the entity object.
Upvotes: 1