First page Back Continue Last page Text

oracle adf workshop

Notes:


Using Groovy Syntax in ADF

The current object is passed in into the script as the “this” object. So to reference any attributes inside the current object, simply use the attribute name. For example, in an attribute-level or entity-level Script Expression validator, to refer to an attribute named “Salary” the script may say simply reference Salary.

There is one top-level reserved name, adf, to get to objects that the framework makes available to the Groovy script. These objects include:

adf.context: To reference the ADFContext object

adf.object: To reference the object on which the expression is being applied

adf.error: In validation rules, to access the error handler that allows the validation expression to generate exceptions (adf.error.raise) or warnings (adf.error.warn)

adf.currentDate : To reference the current date with time truncated

adf.currentDateTime : To reference the current date and time

All the other accessible member names come from the context in which the script is applied:

Bind Variable: The context is the variable object itself. You can reference the structureDef property to access other information as well as the viewObject property to access the view object in which the bind variables participate.