Discussions
Categories
- 196.8K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.3K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 544 SQLcl
- 4K SQL Developer Data Modeler
- 187K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.5K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 439 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
How faces messages stop the user action

Hi Team
jdev: 12.2.1.2.0
As per our requirement we need to add few validations based on other components
so we are doing validations in value changes listener and adding error messages to component
but it's not stopping user to save the record
value change listener code :
But user is able to save the record even though we thrown the error to that particular component
can anyone suggest me here how to stop the user until he /she correct the data
Note: we tried with validator but it's not executing properly
example: if my expiration date is 16th June 2022 and we are trying to give 17th June 2022 as part expiration date then it's throwing error (it's good) but it still giving error when we go back to expiration date and change the date as 30th June 2022
due to this we moved validation code to valuechange listener
Best Answer
-
Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,457 Red Diamond
Well, I gave my suggestion and in the end, you'll see that it works this way. Why does it matter if they are customer validations?
Your application has to make sure that they are enforced. The customer should not allow you to write wrong data into the DB. Only a DB validation can ensure that.
As I said, you can and should validate in the UI, but you have to make sure the data written into the db is correct.
Timo
Answers
-
Not the value change listener, but code validation in ADF BC View Object Before Commit Method
beforeCommit()
. If yourbeforeCommit()
logic can throw aValidationException
, you must set thejbo.txn.handleafterpostexc
property totrue
in your configuration to have the framework automatically handle rolling back the in-memory state of the other entity objects that may have already successfully posted to the database (but not yet been committed) during the current commit cycle.For detail please refer https://docs.oracle.com/middleware/1213/adf/develop/adf-bc-validation-events.htm
-
Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,457 Red Diamond
This kind of validation belongs to the model layer. If you add this validation to the EO attribute and throw the error there, the data will not be saved.
Doing the validation in the UI is OK as you avoid the server roundtrip, but in the end, you have to do the validation before committing the data. My assumption is that the DB will do this validation again to make sure that only valid data is stored in the DB.
The validation in the DB is needed to avoid you (or any other developer or user knowing the DB) from changing the data into something that is not valid for your business.
Timo
-
Hi Timo ,
Thanks for your response.
These are customer validations (these should be get/prompted immediately ) and Data base doesn't have any validations
-
can anyone suggest me here
-
Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,457 Red Diamond
Well, I gave my suggestion and in the end, you'll see that it works this way. Why does it matter if they are customer validations?
Your application has to make sure that they are enforced. The customer should not allow you to write wrong data into the DB. Only a DB validation can ensure that.
As I said, you can and should validate in the UI, but you have to make sure the data written into the db is correct.
Timo