9-6 Desktop Integration Developers Guide for Oracle Application Development Framework
ADF Desktop Integration does not evaluate or apply results when a user navigates between cells or during upload.
The following examples show different contexts where you can use EL expressions to determine the behavior and appearance of Oracle ADF components at runtime.
Example 9–1 applies a style dynamically during download. If the status value for
binding is Closed, apply a read-only style MyReadOnlyStyle. Otherwise apply another style MyReadWriteStyle.
Example 9–1 Applying a Style Dynamically During Download
=IF{bindings.Status} = Closed, MyReadOnlyStyle, MyReadWriteStyle Example 9–2
uses a mixture of Excel formulas and ADF binding expressions to handle errors and type conversion.
Example 9–2 EL Expressions to Handle Errors and Type Conversion
=IFISERRORVALUE{bindings.DealSize}, BlackStyle, IFVALUE{bindings.DealSize} 300, RedStyle, BlackStyle
9.3.1 What Happens at Runtime When an EL Expression Is Evaluated
When evaluating EL expressions at runtime, ADF Desktop Integration determines the value that the EL expression references. It then replaces the EL expression in the Excel
formula with the value. In Example 9–1
, ADF Desktop Integration first determines that value of the EL expression, {bindings.Status}, in the following Excel formula:
=IF{bindings.Status} = Closed, MyReadOnlyStyle, MyReadWriteStyle It then replaces the EL expression with the runtime value, as in the following example,
where the expression evaluated to Closed: =IFClosed = Closed, MyReadOnlyStyle, MyReadWriteStyle
Excel evaluates the formula and, in this example, applies the MyReadOnlyStyle style.
9.3.2 How to Write an EL Expression That Applies a Style at Runtime
You write EL expressions for the Oracle ADF component properties that support EL expressions in the Edit Expression dialog that is accessible from the Oracle ADF
component’s property inspector. Figure 9–5
displays an Edit Expression dialog launched from the property inspector window of an ADF Button component.
Configuring the Appearance of an Integrated Excel Workbook 9-7
Figure 9–5 Edit Expression Dialog
To write an EL expression that applies a style at runtime: 1.
Open the integrated Excel workbook.
2. Select a cell in the Excel worksheet that references the Oracle ADF component for
which you want to write an EL expression.
3. Click the Edit Component button in the Oracle ADF tab to display the property
inspector.
4. Select the property in the property inspector with which you want to associate an
EL expression and click the ellipsis button ... to display the Edit Expression dialog.
The Edit Expression dialog, as illustrated in Figure 9–5
, displays a hierarchical list of the Oracle ADF components, bindings, styles, resources, and Excel functions
that you can reference in EL expressions. For more information about the syntax of EL expressions that you enter in this dialog, see
Appendix B, ADF Desktop Integration EL Expressions.
9.3.3 What You May Need to Know About EL Expressions That Apply Styles
Note the following points when writing EL expressions that apply styles at runtime.
How the ADF Desktop Integration Applies Styles EL expressions that evaluate to styles are applied when:
Note:
The Edit Expression dialog appears only if the Oracle ADF component that you selected in Step 2 supports EL expressions.
Depending on the context, the ellipsis button ... can launch other editors such as the Action Collection Editor.
9-8 Desktop Integration Developers Guide for Oracle Application Development Framework
■
An ADF Table component invokes its Download or DownloadForInsert actions
■
Rows are inserted into an ADF Table component
■
A worksheet invokes its DownSync action EL expressions that evaluate to styles are not applied when:
■
An ADF Table component invokes its RowDownSync action
■
The end user edits the format properties of a cell Note also that an EL expression that evaluates to a style is not reevaluated when
the end user edits a cell’s value.
■
The runtime value of an EL expression does not match a style defined in the end user’s integrated Excel workbook
In this scenario the style formats of the targeted cells do not change. Instead, they retain their existing style formats. If you configured client-side logging, ADF
Desktop Integration generates an entry in the log file when an EL expression evaluates to a style that is not defined in the end user’s integrated Excel
workbook. For more information about client-side logging, see
Section C.3, Generating Log Files for an Integrated Excel Workbook.
9.4 Using Labels in an Integrated Excel Workbook
Use labels to provide end users with information about how they use the functionality in an integrated Excel workbook. You can write EL expressions that retrieve the value
of string keys defined in a resource bundle or that retrieve the values of attribute control hints. An integrated Excel workbook evaluates the value of a Label property
only when the workbook is initialized.
Retrieving the Values of String Keys from a Resource Bundle
Figure 9–6 shows a portion of the design time view of the EditPriceList-DT.xlsx
workbook in the Master Price List module. It shows examples of ADF Label components and ADF Button components that have EL expressions specified for their
Label properties.
Figure 9–6 Design Time View of an ADF Label Component and an ADF Button
Component with Label Property
At runtime, these EL expressions resolve to string keys defined in the res resource bundle that is registered with the Master Price List module. You define resource
bundles in the workbook properties dialog. For information about referencing string keys from a resource bundle, see
Section 10.2, Using Resource Bundles in an Integrated Excel Workbook.
Figure 9–7 shows the corresponding runtime view of the ADF Label component and
ADF Button component illustrated in design mode in Figure 9–6
.