-
Book Overview & Buying
-
Table Of Contents
Oracle ADF 11gR2 Development Beginner's Guide
By :
Let us work on the Script expression validator for the Job attribute to understand the full advantages of
Groovy expressions. Follow these steps:
Select the Job attribute in the EmpEO entity object from the Attributes list.
Click on the + icon to add a new validator.
Select the Script Expression validator for the Rule Type option. This will open an Expression editor section to write the script.
Enter the following code in this editor section:
String value = newValue;
String trim = value.trim();
if(trim.equals('MANAGER')){
adf.error.warn('NO_VACANCY');
return false;
}
return true;
You can click on the Text Syntax button to check if the syntax is correct.
Click on the OK button to add the script expression.
We have added a
script validation for the Job attribute. The script is written to do the following:
Assign the current value to the variable called value.
The trimmed value is saved in a variable called trim.
We are checking if...
Change the font size
Change margin width
Change background colour