Developer Tools
JDeveloper
Expression Language (EL) allows you to use simple expressions in JSF pages to access data stored in objects or reference and invoke methods.
The entire declarative component definition is contained with the
af:componentDef element. Within
af:componentDef are the individual components that make up the declarative component's layout, as well as the
af:xmlContent element that contains declarative component metadata such as attributes and methods.
By default, JDeveloper assigns the
var and
componentVar attributes of
af:componentDef the values of
attrs and
component, respectively, as shown in the following code snippet:
<af:componentDef var="attrs" componentVar="component">
The
var attribute specifies the EL variable name to use to access the declarative component's own attributes. The
componentVar attribute specifies the EL variable name to use when referring to the declarative component instance itself.
To specify where an attribute should be used in the declarative component, on the appropriate property of a component in the declarative component layout, you use an EL expression that references the
var EL variable and the attribute name. For example:
<af:panelHeader text="#{attrs.pheader-title} />
...where
pheader-title is the attribute name defined in the metadata.
To specify where a method should be used in the declarative component, on the appropriate property of a component in the declarative component layout, you use an EL expression that references the
componentVar EL variable and the method name. For example:
<af:commandButton actionListener="#{component.handleMethod1} />
...where
method1 is the method name defined in the metadata.
In the Property Inspector, you can enter an expression directly into a field, or you can use the Expression Builder tool to select a value for insertion. To open the tool, click the
dropdown menu at the end of an appropriate field in the Property Inspector and choose
Expression Builder.
The declarative component's
var and
componentVar EL variable names are located under
JSP Objects. To create an expression, select a variable value.
Copyright © 1997, 2009, Oracle. All rights reserved.