O'Reilly logo

Oracle ADF 11gR2 Development Beginner's Guide by Vinod Krishnan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – adding a script expression

Let us work on the Script expression validator for the Job attribute to understand the full advantages of Groovy expressions. Follow these steps:

  1. Select the Job attribute in the EmpEO entity object from the Attributes list.
  2. Click on the + icon to add a new validator.
  3. Select the Script Expression validator for the Rule Type option. This will open an Expression editor section to write the script.
  4. 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;
    Time for action – adding a script expression
  5. You can click on the Text ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required