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 – setting a default salary for employees

For example, consider a case wherein we want to set a default value for the salary attribute in the EmpEO.xml file based on the Deptno attribute. In this case, we have to provide an expression that will be evaluated at runtime to provide the default value. The following steps show us how to do this:

  1. Click on the Sal attribute from the list of attributes displayed in the Attributes section of EmpEO.xml.
  2. In the Default Value section, select the Expression option. Now the pencil icon will be enabled for the textbox below the Expression option.
  3. Click on the pencil icon to open an Edit Expression Editor window, and add the following code in the Expression editor box:
    if(Job == 'MANAGER'){ Sal = ...

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