Book Image

Oracle ADF 11gR2 Development Beginner's Guide

By : Vinod Thatheri Krishnan
Book Image

Oracle ADF 11gR2 Development Beginner's Guide

By: Vinod Thatheri Krishnan

Overview of this book

Oracle ADF is an end-to-end framework which makes application development simple by providing infrastructure services as well as visual and declarative development right away. "Oracle ADF 11gR2 Development Beginner's Guide" guides any user with programming skills to be able to quickly learn the options and ways to develop rich Internet applications using ADF 11gR2. Containing all the skills that a new user has to use to build an application in ADF 11gR2, this book is designed in such a way so that it enhances the practical feel of developing applications in ADF 11gR2. Starting with the installation and configuration of Oracle ADF 11g RD we will then work through topics such as working with the Model Layer and Model Data followed by displaying and binding the data. Later we will look at Navigations and Flows within applications as well as their layout, look, and feel. "Oracle ADF 11g R2 Development Beginner's Guide" will conclude with us looking at the security and deployment of the applications which have been created.
Table of Contents (19 chapters)
Oracle ADF 11gR2 Development Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Pop Quiz Answers
Index

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;
  5. You can click on the Text Syntax button to check if the syntax is correct.

  6. Click on the OK button to add the script expression.

What just happened?

We have added a script validation for the Job attribute. The script is written to do the following:

  1. Assign the current value to the variable called value.

  2. The trimmed value is saved in a variable called trim.

  3. We are checking if...