First page Back Continue Last page Text

oracle adf workshop


Expression Language and Bindings (continued)

BindingObject is the ID (or, in the case of attributes, the name) of the binding object as it is defined in the page definition file. The binding objectID or name is unique to that page definition file. An EL expression can reference any binding object in the page definition file, including parameters, executables, or value bindings.

propertyName is a variable that determines the default display characteristics of each databound UI component and sets properties for the binding object at run time. There are different binding properties for each type of binding object.

The JDeveloper Expression Builder is a dialog box that helps you build EL expressions by providing lists of binding objects defined in the page definition files, as well as other valid objects to which a UI component may be bound. It is particularly useful when creating or editing ADF databound expressions because it provides a hierarchical list of ADF binding objects and their most commonly used properties. For information about these objects and properties, see the Oracle Fusion Middleware Fusion Developer’s Guide for Application Development Framework 11g, which is available on OTN.

The example in the slide shows an ADF Faces inputText component (a text field with label) that displays the employee name. The attributes of the text field are all set using EL expressions; the dot-separated expressions in the example all start with bindings, the binding variable that represents the binding context of the current page. This is explained further in later slides.

The attributes are evaluated as follows:

value="#{bindings.Ename.inputValue}" : The value of the inputText component is set to the value of the Ename attribute.

label="#{bindings.Ename.label}" : The label is set to the label property of the Ename attribute. If you have assigned a custom label to Ename, then the label property is your custom label; otherwise the label property is the same as the attribute name.

required="#{bindings.Ename.mandatory}" : required is a boolean attribute that determines whether a value must be entered in the field. In this case required evaluates to the mandatory property of the Ename attribute. If Ename is a mandatory attribute, then the inputText requires a value and is displayed with a required indicator (*) next to the field.