7 Working with ADF Desktop Integration Table-Type Components

This chapter describes the table-type components that ADF Desktop Integration provides, how to configure and use them, how to download data from Fusion web application, how to insert, update, and delete data rows from the table-type components in the integrated Excel workbook, how to track the changes, how to configure special columns in the table-type components, and other tasks that you can do with table-type components.

7.1 Introduction to ADF Desktop Integration Table-Type Components

The ADF Table and ADF Read-only Table components provide end users with the functionality to download and upload rows of data. The ADF Table component also enables end users to edit or delete downloaded data, or to insert new rows of data. Figure 7-1 shows the ADF Table and the ADF Read-only Table components.

Figure 7-1 ADF Desktop Integration Table-Type Components

Each ADF Table component contains a Key column. Do not remove the Key column, as it contains important information that is used by ADF Desktop Integration for the proper functioning of the table. Removal of the Key column, or any modification in the Key column cell, results in errors and data corruption. For more information about the Key column, see Section 7.12, "Configuring ADF Table Component Key Column."

7.2 Page Definition Requirements for an ADF Table Component

The ADF Table component is one of the Oracle ADF components that ADF Desktop Integration exposes. It appears in the components palette of the ADF Desktop Integration Designer task pane and, after inserted into an Excel worksheet, allows the following operations:

Read-only

Insert-only

Update-only

Insert and update

Review the following sections for information about page definition file requirements specific to an ADF Table component.

Expose the following control bindings when you create a page definition file for authoring an ADF Table component:

Tree binding that exposes the desired attribute bindings. Note that ADF Desktop Integration only supports Scrollable access mode for a ViewObject. The other access modes are not supported.

Method action bindings and action bindings if you intend to configure values for the ADF Table component's RowActions and BatchOptions groups of properties. Examples of procedures where you set values for these groups of properties include:

As Excel displays a flat list of bindings and iterators are not displayed, use descriptive names for the attributes of different iterators.

Figure 7-2 shows the bindings that the ExcelCustomers.xml page definition file includes. This page definition file can support the use of an ADF Table component in the Excel worksheet that it is associated with.

Figure 7-2 ADF Bindings Supporting Use of an ADF Table Component

7.3 Inserting ADF Table Component into Excel Worksheet

After you have configured a page definition file correctly, you can insert the ADF Table component into the worksheet and configure its properties to achieve the functionality you want. The ADF Table component enables you to download, edit, and upload rows of data.

7.3.1 How to Insert ADF Table Component

You can insert the ADF Table component from the ADF Desktop Integration Designer task pane.

To insert ADF Table component into Excel worksheet:

Open the integrated Excel workbook.

Select the cell in the Excel worksheet into which you want to insert the ADF Table component.

When inserting an ADF Table component, you must ensure that the data of two tables does not overlap at runtime, and the selected cell is not a merged cell.

In the bindings palette of the ADF Desktop Integration Designer task pane, select the tree binding to use and click Insert Binding.

Based on your selection, the Select Component dialog or the Insert Component dialog appears.

In the dialog that appears, select ADF Table and click OK.

Notes:

You can also insert an ADF Table component by using the components palette or the Oracle ADF tab. Select ADF Table and click Insert Component. Alternatively, in the Oracle ADF tab, select ADF Table from the Insert Component dropdown list. If you use either the components palette or the Oracle ADF tab to create the table component, you would have to add each column manually to appear in the component at runtime.

You cannot insert an ADF Table component in a merged cell.

When you insert an ADF Table component using Insert Binding, then by default, InputText is defined as the subcomponent type for all columns.

Configure properties for the ADF Table component using the property inspector shown in Figure 7-3.

Figure 7-3 ADF Table Property Inspector

Specify a binding expression for the attribute that uniquely identifies each row in the iterator associated with the tree binding. The UniqueAttribute property may be left blank if the binding's iterator supports row keys.

Configure the BatchOptions properties of the ADF Table component as described in Table 7-1.

Table 7-1 BatchOptions Properties of the ADF Table Component

Set this property to...

This value...

CommitBatchActionID

The Commit action binding that the page definition file exposes.

Optionally, configure the RowLimit group of properties to determine what number of rows the ADF Table component can download.

7.3.2 How to Add a Column in an ADF Table Component

After inserting an ADF Table component in the worksheet of your integrated Excel workbook, you may want to add a column that is not available in the tree binding. For example, you may want to add a column that displays values calculated by an Excel formula.

To add a column in an ADF Table component:

Open the integrated Excel workbook.

Select the cell in the Excel worksheet that references the ADF Table component and click the Edit Properties button in the Oracle ADF tab.

In the Edit Component: ADF Table dialog, click the browse (...) icon of the Columns property.

The Edit Columns dialog appears, listing all the columns of the selected ADF Table component.

Click Add to add a new column. The new column is inserted at the end of the Members list. To move the column to a specific position, select the column and use the Up and Down arrow keys.

Configure the new column's properties in the right pane of the dialog.

Click OK.

Note:

If you have not moved the new column as described in Step 4, it appears at the left of Key column.

ADF Desktop Integration does not limit the number of columns you can add in an ADF Table component you can add as many columns as your version of Excel supports. However, it has been observed that a very wide table gives slow performance and poor user experience. If you experience the same, you must try reducing the number of columns of the table before diagnosing other reasons for slow performance.

7.4 Configuring an ADF Table Component to Update Existing Data

When you add the ADF Table component, by default, it allows end users to edit the existing data, but it does not allow them to add new data rows or to delete existing data rows.

7.4.1 How to Configure an ADF Table Component to Update Data

If you want the end user to be able to edit existing data, but would like to restrict the addition or deletion of data rows, no additional configuration is required. Ensure that the ADF Table component RowAction properties are set, as described in Table 7-2. and shown in Figure 7-6.

Table 7-2 RowAction Properties of ADF Table Component

Property

Value

InsertRowEnabled

False

DeleteRowEnabled

False

UpdateRowEnabled

True

Figure 7-6 ADF Table RowAction Properties to Update Data

7.4.2 What Happens at Runtime: How the ADF Table Component Updates Data

Excel uploads modified rows from the integrated workbook in batches rather than row by row. You can configure the size of batches and the actions an ADF Table component invokes when it uploads a batch. For more information about batch processing, see Section 7.10, "Batch Processing in an ADF Table Component."

7.5 Configuring an ADF Table Component to Insert Data

The primary purpose of an ADF Table component is to provide end users with an interface where they can input or edit data which can then be uploaded to the database that serves your Fusion web application. For this to happen, you must expose methods on data controls, create action bindings in your page definition file, and set properties for the ADF Table component that an Excel worksheet hosts. Note that a full Excel row must be inserted for this functionality to work correctly.

7.5.1 How to Configure an ADF Table Component to Insert Data Using a View Object's Operations

If you want the changes that the end user makes in an ADF Table component to be committed invoking the ADF Table component's Upload action, you must configure some of the ADF Table component's properties.

To configure an ADF Table component to insert data using a view object's operations:

Open the project in JDeveloper.

If not present, add a CreateInsert and a Commit action binding to the page definition file that is associated with the Excel worksheet that hosts the ADF Table component.

Select the cell in the Excel worksheet that references the ADF Table component and click the Edit Properties button in the Oracle ADF tab.

In the Edit Component: ADF Table dialog, configure the RowActions properties of the ADF Table component as described in the Table 7-3:

Table 7-3 RowActions properties of ADF Table component

Set this property to...

This value...

InsertRowEnabled

True

InsertBeforeRowActionID

The CreateInsert action binding that the page definition file exposes.

InsertRowsAfterUploadEnabled

True, to upload the inserted rows again regardless of whether they have been previously uploaded. By default, this property is set to False.

The property is ignored if InsertRowEnabled is set to False.

Configure the BatchOptions properties of the ADF Table component as described in the Table 7-4.

Table 7-4 BatchOptions Properties of the ADF Table Component

Set this property to...

This value...

CommitBatchActionID

The Commit action binding that the page definition file exposes.

Configure the Columns property of the ADF Table component as described in the Table 7-5.

Table 7-5 Columns property of ADF Table component

Set this property to...

This value...

InsertUsesUpdate

True

UpdateComponent

Set the Value field of the UpdateComponent property to the update attribute from the page definition file. For example, #{row.bindings.ProductId.inputValue}.

Verify that ReadOnly property of UpdateComponent is set appropriately.

This property only appears if you selected InputText or TreeNodeList as the subcomponent to associate with the column. Set ReadOnly to False if you do want users to edit the values in the column, set to True otherwise.

Set a value in this field that uniquely identifies the column in the ADF Table component's list of columns. A value for this property is required. The ADF Table component generates an initial value that you need not modify.

If you are using a polymorphic view object and want to insert a new row, the default CreateInsert action binding is not sufficient. You must create a custom method that also sets the discriminator value in the newly created row.

While creating the custom method, you must expose the custom method as an action binding in the page definition file. The action binding must be specified as the InsertBeforeActionId rather than CreateInsert.

If the InsertRowsAfterUploadEnabled property is set to False and the end user tries to upload the inserted rows again, an error message in the status column is displayed indicating that the row cannot be inserted more than once.

After you add an ADF Table component to a worksheet, you configure it and the worksheet that hosts it, so that the ADF Table component downloads data from the Fusion web application. To achieve this, you configure an Oracle ADF component, such as a worksheet ribbon command, to invoke an action set. The action set that is invoked must include the ADF Table component Download action among the actions that it invokes.

The number of rows that an ADF Table or an ADF Read-only Table component contains expands or contracts based on the number of rows to download from a Fusion web application. You should not place anything to the left or right of a table-type component unless you want to replicate it when Excel inserts rows to accommodate the data that one of the table-type components downloads. You can place other components above or below a table-type component as they maintain their position relative to the table-type component at runtime. End users who want to insert new rows of data into an ADF Table component at runtime must insert full rows into the Excel worksheet that hosts the ADF Table component.

7.6.1 How to Configure an ADF Component to Download Data to an ADF Table Component

Configure an Oracle ADF component, a worksheet ribbon button, or a worksheet event to invoke an action set that, in turn, invokes the ADF Table component Download action.

To configure an ADF component to download data to an ADF Table component:

Open the integrated Excel workbook.

Open the Edit Action dialog to configure an action set for the worksheet event, worksheet ribbon button, or Oracle ADF component (a button, for example) that is going to invoke the action set at runtime.

Add the ADF Table component Download action to the list of actions that the action set invokes at runtime.

The ADF Table component Download action downloads the current state of the binding referenced by the ADF Table component TreeID property. To ensure that the state of this binding is up to date before download, add a query action that refreshes the binding before the action set invokes the ADF Table component Download action.

Figure 7-7 shows the Edit Action dialog in the EditCustomers-DT.xlsx workbook where the action set invoked by the worksheet event Startup is configured.

Figure 7-7 Action Set Downloading Data to an ADF Table Component

Click OK.

7.6.2 What Happens at Runtime: How the ADF Table Component Downloads Data

The end user invokes the action set that you configured. The action set invokes the list of actions specified in order. These include an action that invokes the Download action of the ADF Table component. This action downloads all rows from the tree binding referenced by the ADF Table component TreeID property. If the tree binding referenced by the TreeID property contains data with a master-detail relationship (for example, a product category with multiple products), the ADF Table component shows the first record in the detail result set (for example, the first product). How you configured the tree binding in the Fusion web application determines which of the detail records is defined as the first record. For more information about using tree bindings to display master-detail data, see the "Using Trees to Display Master-Detail Objects" section in the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

Any filter criteria that has been applied to the worksheet automatically gets cleared prior to the Download operation.

7.7 Configuring a Worksheet to Download Pre-Insert Data to an ADF Table Component

Pre-insert data is the data in the Fusion web application's iterator that has not been committed to the database. You can configure the iterator to populate values for some or all of its attributes.

At design time in the integrated Excel workbook, you can configure an ADF Table component and the worksheet that hosts it so that the ADF Table component downloads pre-insert data from the Fusion web application. To achieve this use case, you configure an Oracle ADF component, such as a worksheet ribbon command, to invoke an action set. The action set that is invoked must include the ADF Table component DownloadForInsert action among the actions that it invokes.

Each row in the iterator is created in the ADF Table as a pending insert row. A subsequent call to Table.Upload attempts to insert each of these rows according to the methods defined in the insert row action properties.

The DownloadForInsert action differs from the Download action as follows:

DownloadForInsert populates table cell data with the value of the EL expression for the insert component that is associated with each column in the ADF Table component. Download populates the table cell data with the EL expression for the update component that is associated with each column in the ADF Table component.

The EL expression #{components.componentID.currentRowMode} returns Insert when evaluated by the DownloadForInsert action. In contrast, the same EL expression evaluated by the Download action returns Update. The componentID part of the EL expression references the ID of the ADF Table component.

Data rows downloaded by the DownloadForInsert action are treated as pending inserts. Data rows downloaded by the Download action are treated as pending updates.

Note the following points to invoke the DownloadForInsert action:

Use the action with data rows that are in the STATUS_INITIALIZED state, as these data rows are ignored when the transaction is committed.

An action set that includes the DownloadForInsert action does not execute this action if an ADF Table component's RowActions.InsertRowEnabled property is set to False.

It serves no purpose to include both the DownloadForInsert and Download actions in the same action set, as the last executed action determines what data appears in the ADF Table component.

Write a custom method action that creates one or more status_initialized rows in the iterator. Invoke this method before calling DownloadForInsert, for example, a startup event.

7.7.1 How to Configure a Worksheet to Download Pre-Insert Data to an ADF Table Component

Configure an Oracle ADF component, such as a worksheet ribbon command, to invoke an action set that, in turn, invokes the ADF Table component DownloadForInsert action.

To configure a worksheet to download pre-insert data to an ADF Table component:

Open the integrated Excel workbook.

Open the Edit Action dialog to configure an action set for the worksheet event, worksheet ribbon button, or Oracle ADF component that is going to invoke the action set at runtime.

Add the ADF Table component DownloadForInsert action to the list of actions that the action set invokes at runtime.

Click OK.

7.7.2 What Happens at Runtime: How the ADF Table Component Downloads Pre-Insert Data

The end user invokes the action set that you configured. The action set invokes the list of actions specified in order. These include an action that invokes the DownloadForInsert action of the ADF Table component. This action downloads pre-insert data from the Fusion web application and inserts it in rows of the ADF Table component in the Excel worksheet. The InsertComponent property is configured for the ADF Table component columns associated with the rows inserted to host the pre-insert data. End users can invoke the ADF Table component's Upload action to commit the pre-insert data to the Fusion web application's database.

7.8 Configuring an ADF Component to Upload Changes from an ADF Table Component

You configure the ADF Table component and the worksheet that hosts it so that end user can upload changes they make to data in the ADF Table component to the Fusion web application. To configure this functionality, you decide what user gesture or worksheet event invokes the action set that invokes the ADF Table component's Upload action.

To provide upload options to end users in a web page from the Fusion web application that differ from the default upload dialog, you must specify a Dialog action in the action set before the action that invokes the ADF Table Component's Upload action. For more information, see Section 7.8.5, "How to Create a Custom Upload Dialog."

Note:

In a master-detail relationship, ADF Desktop Integration does not support editing of the ViewLink source attributes, as the selections in the child view object would change as a result. To prevent any accidental editing, define the ViewLink source attributes to be read-only, or use a model configuration that does not include a view link between master and detail.

7.8.1 How to Configure an ADF Component to Upload Data from an ADF Table Component

Configure an ADF component, such as a worksheet ribbon command, to invoke an action set that, in turn, invokes the ADF Table component Upload action.

To configure an ADF component to upload changed data from an ADF Table component:

Open the integrated Excel workbook.

Open the Edit Action dialog to configure the action set that invokes the ADF Table component Upload action.

7.8.2 What Happens at Runtime: How the ADF Table Component Uploads Data

At runtime, the end user invokes the action set through whatever mechanism you configured (ADF component, worksheet ribbon button, worksheet event). This triggers the following sequence of events:

If the ADF Table component contains dynamic columns, ADF Desktop Integration verifies whether the dynamic columns that were expanded the last time the ADF Table component's Download action was invoked are still present in the Fusion web application. If the columns are not present, ADF Desktop Integration prompts the end user to determine whether to continue upload process. If the end user decides not to continue, ADF Desktop Integration returns an abort code to the executing action set.

If the ADF Table component contains no pending changes to upload, the ADF Table component's Upload action returns a success code to the executing action set.

If the end user clicks Cancel, ADF Desktop Integration returns an abort code to the executing action set. If the end user clicks OK, the action set continues executing with the options specified in the dialog for the upload operation.

The ADF Table component uploads modified rows in batches, rather than row by row. You can configure the batch options using the BatchOptions group of properties. For more information about batch options for the ADF Table component, see Section 7.10, "Batch Processing in an ADF Table Component."

Each row of a batch is processed in the following way, and the process continues until all changed rows of each batch are processed:

For inserted rows, invoke the InsertBeforeRowActionID action, if specified.

Set attributes from the worksheet into the model, including any cached row attribute values.

For edited rows, invoke the UpdateRowActionID action; and for inserted rows, invoke the InsertAfterRowActionID action, if specified.

For any row failure, it verifies the value of AbortOnFail. If AbortOnFail is set to False, it continues upload process, otherwise it stops uploading data and invokes the commit action.

While uploading data, the ADF Table component returns a success or failure code to the executing action set based on the following:

If the ADF Table component uploads all batches successfully, it returns the success status to the executing action set. If the end user has selected the Download all rows after successful upload option in Step 3, the ADF Table component then downloads all rows from the Fusion web application.

If the ADF Table component did not upload all batches successfully, the action set invokes the action specified by the RowActions.FailureActionID property, if an action is specified for this property. ADF Desktop Integration returns a failure code to the action set.

If you selected On failure, continue to upload subsequent rows in the Upload Options dialog of Step 3, the Upload action returns a success code to the action set even if some individual rows encountered validation failures.

7.8.4 What Happens at Runtime: Upload Failure

When the ADF Table component starts uploading data, ADF Desktop Integration creates a DataControlFrame savepoint before initiating the upload process (once per batch of uploaded rows). In case of any failure, ADF Desktop Integration reverts back to the same savepoint, ensuring the integrity of the server-side state of the Fusion web application.

For each row in a batch of uploaded rows, ADF Desktop Integration does the following:

7.8.5 How to Create a Custom Upload Dialog

You display a page from Fusion web application that offers end users different options to those presented in the default upload dialog. You add a Dialog action before the action that invokes the ADF Table component's Upload action in the action set.

If you set this element to True, the action set stops uploading if it encounters a failure. If the element references False, the action set attempts to upload all rows and indicates if each row succeeded or failed to upload.

ADFdi_DownLoadAfterUpload

Set this element to True so the action set downloads data from the Fusion web application to the ADF Table component after the action set uploads modified data.

Note:

The page you create must include both elements to prevent ADF Desktop Integration presenting the default upload dialog to end users.

Add a Dialog action to invoke the page you created in Step 1 before the action in the action set that invokes the ADF Table component's Upload action.

7.8.6 What Happens at Runtime: Custom Upload Dialog

When a custom dialog appears, the page from the Fusion web application that you configure the Dialog action in the action set to display appears instead of the default upload dialog.

Note:

If there is no server connectivity when the end user tries to upload data, the end user gets an error when the Dialog action fails to find the custom upload page. ADF Desktop Integration does not revert to the standard dialog when server connectivity is not available.

The ADF Table component exposes an action (DeleteFlaggedRows) that, when invoked, deletes the rows in the Fusion web application that correspond to the flagged rows in the ADF Table component. A flagged row in an ADF Table component is a row where the end user has double-clicked or typed a character in the cell of the _ADF_FlagColumn column as described in Section 7.10, "Batch Processing in an ADF Table Component." The _ADF_FlagColumn column must be present in the ADF Table component to configure it to delete rows in the Fusion web application.

In addition, the page definition file that you associate with the worksheet that hosts the ADF Table component must expose a Delete action binding.

7.9.1 How to Configure an ADF Table Component to Delete Rows in the Fusion Web Application

To delete rows from an ADF Table component, you must add the Delete action binding to the page definition file, configure RowActions group of properties of the ADF Table component, and configure an action set to invoke the DeleteFlaggedRows action.

To configure an ADF Table component to delete rows in a Fusion web application:

Open your Fusion web application in JDeveloper.

If not present, add a Delete action binding to the page definition file that is associated with the Excel worksheet that hosts the ADF Table component.

7.9.2 What Happens at Runtime: How the ADF Table Component Deletes Rows in a Fusion Web Application

If specified, the action binding referenced by the BatchOptions.StartBatchActionID property is invoked.

Failures from this step are treated as errors. An error stops the action set invoking. It also returns the error condition to the action set. If an action binding is specified for the ActionSet.FailureActionID property, the action set invokes the specified action binding.

The action set invokes the Delete action binding specified by RowActions.DeleteRowActionID.

Note:

Rows inserted since the last invocation of the ADF Table component's Download action but not uploaded to the Fusion web application are ignored even if flagged for deletion.

If no errors occur during the invocation of the Delete action binding, a success message entry appears in the _ADF_StatusColumn column. If a failure occurs, the ADF Table component stops invocation of the Delete action binding and continues to Step 4.

If an action binding is specified for the BatchOptions.CommitBatchActionID property, the action set invokes it. If this step fails, the action set stops processing batches. If no failures occur, the action set processes the next batch by invoking the action binding specified by the BatchOptions.StartBatchActionID property, and so on until the action set processes all batches.

If the action set processes all batches successfully, it invokes the action binding specified by its ActionOptions.SuccessActionID property if an action binding is specified for this property. It then removes the rows deleted in the Fusion web application by invocation of the Delete action binding specified by RowActions.DeleteRowActionID from the worksheet and returns a success code to the action set.

If failures occur while the action set processes the batches, the action set invokes the action binding specified by its ActionOptions.FailureActionID property if an action binding is specified for this property. This action binding returns a failure code to the action set.

If an unexpected exception occurs while the action set invokes its actions, an error code is returned to the action set. All row-level errors are displayed in the Status column, and all batch-level errors can be tracked through Table.errors. For more information about error handling, see Section 12.4, "Error Reporting in an Integrated Excel Workbook."

7.10 Batch Processing in an ADF Table Component

The ADF Table component uploads modified rows from the Excel workbook in batches rather than row-by-row. You can configure batch option properties that determine the size of batches and what actions the ADF Table component invokes when it uploads a batch.

Select the cell in the Excel worksheet that references the ADF Table component, and then click the Edit Properties button in the Oracle ADF tab.

Set values for the BatchOptions group of properties in the property inspector that appears.

Table 7-8 RowData.BatchOptions Properties

Set this property...

To...

BatchSize

Specify how many rows to process before an ADF Table component action (Upload or DeleteFlaggedRows) invokes the action binding specified by CommitBatchActionID. Any value other than a positive integer results in all rows being processed in a single batch. The default value is 100 rows.

CommitBatchActionID

The action binding to invoke after the ADF Table component processes each batch. Typically, this is the Commit action binding.

LimitBatchSize

True

When True, the ADF Table component processes rows in batches determined by the value of BatchSize. When False, the ADF Table component uploads all modified rows in a single batch.

True is the default value.

StartBatchActionID

Specify the action binding to invoke at the beginning of each batch.

Click OK.

Note that a failure at the entity-level is not considered a batch failure. A failure at the commit level (for example, a wrong value for a foreign key attribute) is considered a batch failure.

7.10.2 Row Flagging in an ADF Table Component

By default, the ADF Table component includes a column, _ADF_FlagColumn, that facilitates the selection of rows for flagged-row processing. Double-clicking a cell of the _ADF_FlagColumn column flags the corresponding row for processing by actions invoked by a component action.

When the end user double clicks a cell of the _ADF_FlagColumn column, a solid circle appears, or disappears, in the cell to indicate that the row is flagged, or not. Figure 7-10 shows an example of a flagged column.

Figure 7-10 Flagged Column in ADF Table Component

Note:

By default, the solid circle character indicates a row flagged for flagged-row processing. However, any nonempty cell in a _ADF_FlagColumn column flags the corresponding row for flagged-row processing.

The following component actions can be invoked on flagged rows:

DeleteFlaggedRows

DownloadFlaggedRows

You can use the FlagAllRows component action to flag all rows, and the UnflagAllRows component action to unflag all rows of the ADF Table component.

Notes:

The ADF Table component's DownloadFlaggedRows action does not support changes in table column structure after the last invocation of the Download or DownloadForInsert action. The table column structure usually changes if you are using dynamic columns, or if the table contains columns with complex expressions in the Visible property.

The DownloadFlaggedRows action is not applicable to inserted rows.

Use of these component actions is dependent on the appearance of the _ADF_FlagColumn column in the ADF Table component. If you remove the _ADF_FlagColumn column from the ADF Table component, you cannot invoke any of these component actions. For more information about these component actions, see Section A.9.3, "ADF Table Component Actions."

At runtime, the end user can invoke any of the previously listed component actions from an action set. The invoked component action processes all flagged rows. For example, it downloads or deletes all flagged rows. For more information about configuring an action set to invoke a component action, see Section 8.2.2, "How to Invoke Component Actions in an Action Set."

7.10.3 Troubleshooting Errors While Uploading Data

End users might encounter unexpected reports of errors under certain circumstances while uploading data from ADF Table components. After posting changes from a batch, ADF Desktop Integration runs the action specified by the CommitBatchActionID. Errors that occur during the commit action might continue to be reported on subsequent batch commit actions, even though those batches of records do not contain the error. This can happen when any pending model updates are not automatically reverted when the CommitBatchActionID action fails.

To avoid any such error, you must explicitly revert pending model updates that exist after a commit failure. For example, you could create a custom action for the CommitBatchActionID that first attempts to commit the pending model changes. However, if an exception occurs during commit, the custom method should first roll back the pending model changes, so that any subsequent batch commit attempts can succeed.

Note:

It is important that the commit exception gets thrown again after rollback so that the commit errors are reported as expected on the client.

7.11 Special Columns in the ADF Table Component

By default, the ADF Table component includes some columns when you insert an ADF Table component in a worksheet. You can retain or remove these columns, if required. The following list describes the columns and the purpose they serve:

_ADF_ChangedColumn

The cells in this column track changes to the rows in the ADF Table component. If a change has been made to data in a row of the ADF Table component since download or the last successful upload, a character that resembles an upward pointing arrow appears in the corresponding cell of the _ADF_ChangedColumn column. This character toggles (appears or disappears) when a user double-clicks a cell in this column. Figure 7-11 shows an example.

Figure 7-11 Changed Column in an ADF Table Component

Note:

If the end user does not want the ADF Table component's Upload action to upload changes in the rows flagged by this column, the user must clear the entry that appears in the corresponding cell.

A confirmation dialog appears to end users when the ADF Table component's Download action is invoked, and one or more rows in this column are flagged as changed. The end user clicks OK to allow the Download action to execute, or Cancel to stop the execution of the Download action.

_ADF_FlagColumn

When the end user double-clicks a cell in this column, the corresponding row is flagged for flagged-row processing. A solid circle character appears to indicate that the row is flagged for flagged-row processing. For more information about the use of this column, see Section 7.10.2, "Row Flagging in an ADF Table Component."

A confirmation dialog appears to end users when the ADF Table component's DownloadFlaggedRows action is invoked, and one or more rows in _ADFChangedColumn and _ADF_FlagColumn are flagged. The end user clicks OK to allow the action to execute or Cancel to stop the execution of the action.

Note:

By default, the solid circle character indicates a row flagged for flagged-row processing. However, any nonempty cell in a _ADF_FlagColumn flags the corresponding row for flagged-row processing.

_ADF_StatusColumn

This column reports the results of invocation of the following ADF Table component actions:

DeleteFlaggedRows

Upload

A message appears in the cell of the _ADF_StatusColumn to indicate the result of the invocation for the corresponding row. If the end user invokes a DoubleClickActionSet defined in an ADF Table column and an error occurs, the errors are also reported in the status column of the corresponding row. Figure 7-12 shows an example of Status column message.

Figure 7-12 Status Column in an ADF Table Component

_ADF_RowKeyColumn

This column, also referred to as the Key column, contains important information about the ADF Table component used by ADF Desktop Integration at runtime. The column appears both at runtime and design time. You can remove the column from the table at design time, but note that it automatically appears at runtime as the last column of the table.

The ADF Table component treats the properties of the _ADF_ChangedColumn, _ADF_FlagColumn, _ADF_RowKeyColumn, and _ADF_StatusColumn columns differently from the properties of other columns that it references. It ignores the values set for properties such as InsertComponent, InsertUsesUpdate, and UpdateComponent unless it invokes the DisplayRowErrors action described in Table A-11. It reads the values for properties related to style and appearance, for example CellStyleName and HeaderStyleName.

7.12 Configuring ADF Table Component Key Column

When you add ADF Table to your integrated Excel workbook, the Key column (column ID: _ADF_RowKeyColumn) appears automatically at design time. The Key column contains important information that is used by ADF Desktop Integration for proper functioning of the table. Note that you must not remove the Key column at runtime.

7.12.1 How to Configure the Key Column

You can configure the Key column's position, style properties, and header label. By default, the _ADFDI_TableKeyCellStyle style is applied to it.

To configure the Key column:

Open the integrated Excel workbook.

Select the cell in the Excel worksheet that references the ADF Table component and click the Edit Properties button in the Oracle ADF tab.

In the Edit Component: ADF Table dialog, click the browse (...) icon beside the input field for Columns.

The Edit Columns dialog appears, listing all the columns of the selected ADF Table component.

Select the column with ID as _ADF_RowKeyColumn.

Change the column properties as desired, but do not change the following properties:

DynamicColumn

InsertComponent

InsertUsesUpdate

UpdateComponent

ID

Visible

If desired, change the position of the column using the Up and Down arrow keys.

Click OK to close Edit Columns dialog.

Click OK to close the Edit Component: ADF Table dialog.

7.12.2 How to Manually Add the Key Column At Design Time

If you are using the integrated Excel workbook prepared and configured using an earlier version of ADF Desktop Integration, the Key column will not be available at design time. It will appear only at runtime. To configure the Key column properties, you can add it in the workbook at design time.

To manually add the Key column at design time:

Open the integrated Excel workbook.

Select the cell in the Excel worksheet that references the ADF Table component, and then click the Edit Properties button in the Oracle ADF tab.

If desired, you may change the position of the Key column using the Up and Down arrow keys.

Click OK.

Note:

You must specify the ID property of the new column as _ADF_RowKeyColumn; otherwise, the column will not be considered to be a Key column, and another Key column will automatically appear at runtime.

7.13 Creating a List of Values in an ADF Table Component Column

Use the TreeNodeList subcomponent when you want to render a dropdown list of values in an ADF Table component column. The list of values can display a maximum of two hundred and fifty values at runtime. Unlike other ADF Desktop Integration components, the TreeNodeList subcomponent does not appear in the components palette described in Section 5.5, "Using the Components Palette." Instead, you invoke it as a subcomponent when you specify values for the InsertComponent or UpdateComponent properties of an ADF Table component column. For information about the properties of an ADF Table component column, see Section A.9.2, "ADF Table Component Column Properties."

After you invoke the TreeNodeList subcomponent, you must specify a tree binding attribute associated with a model-driven list as a value for the TreeNodeList subcomponent's List property. The tree binding attribute associated with a model-driven list populates the dropdown menu in the Table component's column with a list of values after invocation of the Table component's Download action.

7.13.1 How to Create a List of Values in an ADF Table Component Column

You add a column to the ADF Table component column and select TreeNodeList as the subcomponent. You then specify a tree binding attribute as the value for the TreeNodeList subcomponent's List property. A model-driven list must be associated with the tree binding attribute that you specify.

Note:

The TreeNodeList subcomponent does not support a model-driven list whose control type is input_text_lov or combo_lov.

To create a list of values in an ADF Table component column:

Open the integrated Excel workbook.

Select the cell in the Excel worksheet that references the ADF Table component and click the Edit Properties button in the Oracle ADF tab.

In the Edit Component: ADF Table dialog, click the browse (...) icon beside the input field for Columns.

The Edit Columns dialog appears, listing all the columns of the selected ADF Table component.

Click Add to add a new column.

Choose the appropriate option for the newly created column:

Click the browse (...) icon beside the input field for InsertComponent to configure the runtime list of values for insert operations.

Click the browse (...) icon beside the input field for UpdateComponent to configure the runtime list of values for update and download operations.

In both options, the Select subcomponent to create dialog appears.

Select TreeNodeList and click OK.

Expand the property that you selected in Step 5 and configure values as follows:

Select a tree binding attribute associated with a model-driven list for the List property.

7.13.2 What Happens at Runtime: How the ADF Table Column Renders a List of Values

At runtime, the ADF Table component invokes the Download action and populates each column. This action also populates the list of values in the column that you configure to render a list of values. Figure 7-14 shows an example from EditCustomers-DT.xlsx of the Summit sample application for ADF Desktop Integration where Country is the column configured to display a list of values.

You can add a ModelDrivenColumnComponent subcomponent to an ADF Table component. The value of ModelDrivenColumnComponent is determined by the Control Type hint specified for each attribute on the server.

At design time, for a column, specify the subcomponent type as ModelDrivenColumnComponent for the UpdateComponent or InsertComponent properties. At runtime, if there is a model-driven list associated with the attribute, then the column uses a dropdown list using the TreeNodeList subcomponent.

Note:

If there is no model-driven list associated with the attribute, or if any non-list-based control type is specified, then the column uses an InputText subcomponent. If there is a model-driven list whose control type is input_text_lov or combo_lov, then the column uses an InputText subcomponent.

For more information about creating a model-driven list, see the "How to Create a Model-Driven List" section of the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

Support for Dependent List of Values

When multiple ModelDrivenColumnComponent list subcomponents are exposed in an ADF Table component, then for each list ADF Desktop Integration determines whether it depends on another model-driven list. It verifies that the bind variable specified for a list references an attribute bound to another list.

If the list depends on another model-driven list, the subcomponent's DependsOnList value is set automatically at runtime.

As server-side list binding dependencies are determined only for lists in the same tree node, the following tree node list bindings are not supported:

A binding that depends on a list binding in a different tree or tree node

A binding that depends on a list binding in the page definition file

7.15 Adding a Dynamic Column to Your ADF Table Component

You can add dynamic columns to an ADF Table component so that the ADF Table component expands or contracts at runtime depending on the available attributes returned by the view object. The DynamicColumn property of the Columns group in the TableColumn array controls this behavior. To make a column dynamic, set the DynamicColumn property to True. A dynamic column in the TableColumn array is a column that is bound to a tree binding or a tree node binding whose attribute names are not known at design time. A dynamic column can expand to more than a single worksheet column at runtime.

ADF Desktop Integration does not support the subcomponent type TreeNodeList in a dynamic column.

Support for Model-Driven List of Values

You can also configure a dynamic column to support the List of Values subcomponent where the subcomponent type is determined from model configuration at runtime. At design time, specify the subcomponent type as ModelDrivenColumnComponent for the UpdateComponent or InsertComponent properties. At runtime, during dynamic column expansion, the model-driven runtime component is determined before caching the list of values. The remote servlet allows the client to retrieve Model configuration, allowing the client to choose the desired column subcomponent type. For more information about ModelDrivenColumnComponent, see Section 7.14, "Adding a ModelDrivenColumnComponent Subcomponent to Your ADF Table Component."

7.15.1 How to Configure a Dynamic Column

You configure a dynamic column by specifying an EL expression with the following format for the Value property of the component specified by the ADF Table component column's InsertComponent property as a subcomponent:

#{bindings.TreeID.[TreeNodeID].AttributeNamePrefix*.inputValue}

or:

#{bindings.TreeID.AttributeNamePrefix*.inputValue}

where:

TreeID is the ID of the tree binding used by the ADF Table component

TreeNodeID is an optional value that specifies the tree node binding ID. If you omit this value, all matching attributes from the tree binding display regardless of which tree node binding the attribute belongs to.

AttributeNamePrefix identifies a subset of attributes that exist within the tree binding's underlying iterator. If you do not specify a value for AttributeNamePrefix, all attributes for the tree binding or tree binding node are returned. Always use the * character.

Note:

While adding a dynamic column, ensure that tree node attribute names are not specified in the page definition file. At runtime, the tree node object returns all attribute names from the underlying iterator. If there are attribute names specified in the page definition file, the tree node object limits the list of available attribute names based on that list.

The following example returns all attributes that begin with the name "period" in the model.EmpView node of the EmpTree binding:

#{bindings.EmpTree.[model.EmpView].period*.inputValue}

7.15.2 What Happens at Runtime: How Data Is Downloaded or Uploaded In a Dynamic Column

When the ADF Table component's Download or DownloadForInsert action is invoked, the ADF Table component automatically updates the dynamic columns so that they contain an up-to-date set of matching attributes. For each invocation of Download, ADF Desktop Integration requires that all rows must have the same set of attributes for the dynamic column. It may generate errors if the set of attributes changes from row to row during Download.

If a dynamic column supports both Insert and Update operations, you should specify the same EL expression for the Value properties of the dynamic column's InsertComponent and UpdateComponent subcomponents. At runtime, the ADF Table component expands to include a dynamic column that displays the value of the attribute binding returned by the EL expression.

When the ADF Table component's Upload action is invoked, the workbook prompts the end user to determine if the end user wants to continue to upload data when the previously downloaded attributes no longer exist in the tree binding.

Support for View Objects with Declarative SQL Mode

To support view objects that are configured with declarative SQL mode and customized at runtime, expose a tree binding in the page definition file that has no attributes defined. For example:

At runtime, the tree binding will return the selected attributes from the underlying declarative SQL mode view object to the integrated Excel worksheet.

7.15.3 How to Specify Header Labels for Dynamic Columns

Use the following syntax to write EL expressions for the HeaderLabel property of a dynamic column:

#{bindings.TreeID.[TreeNodeID].hints.AttributeNamePrefix*.label}

or:

#{bindings.TreeID.hints.AttributeNamePrefix*.label}

Specify the same tree binding ID, tree node binding ID, and attribute name prefix values in the HeaderLabel property of the dynamic column as the values you specify for the Value properties of the dynamic column's InsertComponent and UpdateComponent if the dynamic column supports Insert and Update operations.

Note:

The ADF Table component ignores the value of a column's Visible property when you configure a column to be dynamic. For more information about ADF Table component column properties, see Table A-10.

If you want the mandatory columns, where the end user must enter a value, to be marked with a character or a string, you must configure the HeaderLabel property. Use the following syntax to write EL expression to add a character or string to all mandatory columns:

The following example shows another scenario where the MyDateStyle style is applied to all date data type columns, MyNumberStyle is applied to all number data type columns, and MyDefaultStyle is applied to other data type columns:

7.16 Creating an ADF Read-Only Table Component

At runtime, the ADF Read-only Table component renders a table across a continuous range of cells that displays data from the tree binding that the ADF Read-only Table component references. Use this component to display data that you do not want the end user to edit.

This component supports several properties, such as RowLimit, that determine how many rows the component downloads when it invokes its Download action. It also includes a group of properties (Columns) that determine what columns from the tree binding appear at runtime in the Excel worksheet. The TreeID property specifies the tree binding that the component references. More information about these properties and others that the ADF Read-only Table component supports can be found in Section A.10, "ADF Read-only Table Component Properties and Actions."

Note that the first column of the ADF Read-only Table contains important data that is used by the table component for proper operation, and it must not be removed. The column is visible at design-time, but is hidden at runtime. At runtime, the content of the worksheet is shifted by one column in the right direction to compensate for the hiding of column A and maintain the visual layout from design-time.

Figure 7-15 shows the ADF Read-only Table component at design time with the property inspector in the foreground.

Figure 7-15 ADF Read-only Table Component at Design Time

Figure 7-16 shows the columns that an ADF Read-only Table component which references the Customers tree binding at runtime.

Figure 7-16 Columns in an ADF Read-only Table Component at Runtime

Note:

At runtime, inserting a row into the ADF Read-only Table component results in a new Excel row that behaves as if it is part of the downloaded data set, but the new row exists only in Excel. The data from the new row is not uploaded to the server, and does not affect the Fusion web application data.

7.16.1 How to Insert an ADF Read-only Table Component

You use the ADF Desktop Integration Designer task pane to insert an ADF Read-only Table component into a worksheet.

To insert an ADF Read-only Table component:

Open the integrated Excel workbook.

Select the cell in the Excel worksheet where you want to anchor the component.

When inserting a table component, you must ensure that the data of two tables does not overlap at runtime, and the selected cell is not a merged cell

In the bindings palette, select the binding to create the ADF Read-only Table component, and then click Insert Binding.

In the dialog that appears, select ADF Read-only Table.

Note:

You can also insert an ADF Read-only Table component by using the components palette or Oracle ADF tab. Select ADF Read-only Table and click Insert Component. If you use the components palette to create the component, you would have to add each column to appear in the component at runtime.

Configure properties in the property inspector that appears to determine the columns to appear and the actions the component invokes at runtime.

Click OK.

Note:

You can modify the properties of the component at a later time by selecting the cell in the worksheet that anchors the component and then displaying the property inspector.

7.16.2 How to Manually Add a Column to the ADF Read-only Table Component

You can manually add additional columns to an ADF Read-only Table component or re-add columns that you previously removed.

To manually add a column to the ADF Read-only Table component:

Open the integrated Excel workbook.

Select the cell in the worksheet that hosts the ADF Read-only Table component and click the Edit Properties button in the Oracle ADF tab.

In the Edit Component: ADF Table dialog, click the browse (...) icon beside the input field for Columns.

The Edit Columns dialog appears, listing all the columns of the selected ADF Table component

Click Add to add a new column to the ADF Read-only Table component.

Set values for the properties of the new column.

For information about the properties of an ADF Read-only Table component column, see Table A-13.

Click OK.

7.17 Limiting the Number of Rows Your Table-Type Component Downloads

You can configure the number of rows that an ADF Table or ADF Read-only Table component downloads by setting values for the component's RowLimit group of properties. You can also display a warning message, if desired, that alerts the end user when the number of rows available to download exceeds the number of rows specified for download.

7.17.1 How to Limit the Number of Rows a Component Downloads

Specify the number of rows that the component downloads when it invokes its Download action as a value for the RowLimit.MaxRows property. Optionally, write an EL expression for the RowLimit.WarningMessage property so that the end user receives a message if the number of rows available to download exceeds the number specified by RowLimit.MaxRows.

To limit the number of rows a table-type component downloads:

Open the integrated Excel workbook.

Select the cell in the Excel worksheet that references the table-type component and click the Edit Properties button in the Oracle ADF tab.

Set to True to limit the number of rows downloaded to the value specified by RowLimit.MaxRows.

RowLimit.MaxRows

Specify an EL expression that evaluates to the maximum number of rows to download.

RowLimit.WarningMessage

Write an EL expression for this property to generate a message for the end user if the number of rows available to download exceeds the number specified by RowLimit.MaxRows.

If the value for this property is null, the Download action downloads the number of rows specified by RowLimit.MaxRows displaying the default warning message to the end user.

Click OK.

Figure 7-17 shows the Edit Component dialog in the EditCustomers-DT.xlsx workbook where the row limit of an ADF Table component is configured.

Figure 7-17 Limiting Number of Rows of an ADF Table Component

7.17.2 What Happens at Runtime: How the RowLimit Property Works

When invoked, the Table-type component's Download action downloads the number of rows that you specified as the value for RowLimit.MaxRows from the Fusion web application. A message dialog similar to the one in Figure 7-18 appears if you specify an EL expression for RowLimit.MaxRows or do not modify its default value.

Figure 7-18 Row Limit Exceeded Warning Message

7.18 Clearing the Values of Cached Attributes in an ADF Table Component

The RowData group of properties described in Table A-9 allow you to specify data to cache in the ADF Table component. For more information about this functionality, see the following:

The ADF Table component exposes an action (ClearCachedRowAttributes) that, when invoked, clears the values of cached attributes for the current row of the ADF Table component.

Do not configure a component (for example, an ADF Table component's column or an ADF Input Text component) so that an end user can view or edit an attribute binding that you have also specified for an element in the RowData.CachedAttributes array. The RowData.CachedAttributes array caches the values retrieved by the worksheet DownSync action. The worksheet UpSync action sends the values of the RowData.CachedAttributes array to the Fusion web application. This may override edits an end user makes to an attribute binding exposed through a component in the worksheet.

7.18.1 How to Clear the Values of Cached Attributes in an ADF Table Component

Configure a DoubleClickActionSet that includes an action to invoke the ADF Table component's ClearCachedRowAttributes action.

To clear the values of cached attributes in an ADF Table component:

Open the integrated Excel workbook.

Open the Edit Action dialog for the Oracle ADF component that is going to invoke the DoubleClickActionSet at runtime.

Add an action to the DoubleClickActionSet that invokes the ADF Table component's ClearCachedRowAttributes action.

Click OK.

7.18.2 What Happens at Runtime: How the ADF Table Component Clears Cached Values

The action set invokes the ADF Table component's ClearCachedRowAttributes action. This action clears the cached values specified by the RowData.CachedAttributes property for the current row of the ADF Table component.

7.19 Tracking Changes in an ADF Table Component

End users can create or modify data in the cells of an integrated Excel workbook that hosts an ADF Table component.

If a column is updatable and not read-only, change tracking is activated. End users can make the following changes to activate change tracking:

Edit cell values

Insert or delete cell values

Paste values to cells in the ADF Table component column that they copied elsewhere

A character that resembles an upward pointing arrow appears in a row of the _ADF_ChangedColumn column if the end user makes a change to data in a corresponding row. Figure 7-19 shows an example.

Figure 7-19 Changed Column in an ADF Table Component

This character appears if the end user makes a change to data hosted by a component where the component's ReadOnly property value is False. The ADF Input Text and TreeNodeList subcomponents both have a ReadOnly property. You can write an EL expression or a static string for this ReadOnly property that evaluates to True or False. If you write a static string or an EL expression that evaluates to True, no character appears in the _ADF_ChangedColumn column. For more information about ReadOnly EL expressions and change tracking, see Section 7.20, "Evaluating EL Expression for ReadOnly Properties."

7.20 Evaluating EL Expression for ReadOnly Properties

If a table column's ReadOnly EL expression contains a binding expression (for example, #{row.bindings.color.inputValue}), the runtime evaluation of that expression will be different depending on when the evaluation occurs. The evaluation happens during the following:

During Upload, or when the end user changes values in the editable table, the EL expression is evaluated differently than Download. Specifically, an empty string is substituted for the binding expression prior to evaluation of the EL expression.

For example, if you have the following EL expression in an editable cell:

=IF("#{row.bindings.color.inputValue}"="RED", True, False)

During Upload, or when the end user changes values in the editable table, the EL expression evaluates to =IF(""="RED", True, False), and always returns False.

7.20.3 What You May Need to Know About Evaluating EL Expression While Uploading Data or Tracking Changes

During Upload and change tracking, an extra round trip to the server would be required to retrieve the binding values, in order to evaluate the EL expression properly. The extra round trip to the server would impact performance negatively, and could even require a new login if the end user did not have a currently valid session.

Note:

The same EL expression evaluation behavior also applies to the CellStyleName EL expression property when inserting new worksheet rows during table change tracking.

Due to the difference in behavior, if possible, you should avoid ReadOnly EL Expressions that contain binding expressions. However, if it is important for a given use case to use an attribute value in the ReadOnly expression, you should consider setting the worksheet protection to Automatic. For more information about worksheet protection, see Section 9.7, "Using Worksheet Protection."

For example, if you have the following EL expression in a cell:

=IF("#{row.bindings.color.inputValue}"="RED", True, False)

During Download, the RED cells in this column will be set to Locked and the end user will not be able to edit those cells.

Scripting on this page enhances content navigation, but does not change the content in any way.