7 Working with ADF Desktop Integration Table-Type Components

This chapter describes how you work with the table-type components that ADF Desktop Integration provides.

This chapter includes the following sections:

7.1 Introduction to ADF Desktop Integration Table-Type Components

ADF Desktop Integration provides the following table-type components to display structured data:

  • ADF Table component

  • ADF Read-only Table component

The ADF Table and ADF Read-only Table components provide end users the functionality to download rows of data from the Fusion web application. The ADF Table component provides additional functionality that allows end users to edit or delete the downloaded data, or to insert new rows of data. The ADF Table component's Upload action is used to upload the resulting data.

The number of rows that an ADF Table or 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.

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 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."

The other ADF Desktop Integration components that you can use with these table-type components are described in Chapter 6, "Working with ADF Desktop Integration Form-Type Components."

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.

Before you can configure an ADF Table component to provide data-entry functionality to your end users, you must configure the underlying page definition file for the Excel worksheet with ADF bindings. For general information about the page definition file requirements for an integrated Excel workbook, see Section 4.3, "Working with Page Definition Files for an Integrated Excel Workbook."

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

Note:

Use descriptive names for the attributes of different iterators. Excel displays a flat list of bindings, so iterators are not displayed.

Figure 7-1 shows the bindings that the ExcelPriceListPageDef.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-1 ADF Bindings Supporting Use of an ADF Table Component

ADF Bindings for use with a DEG

7.3 Inserting an ADF Table Component into an 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.

To insert an ADF Table component into an Excel worksheet:

  1. Open the integrated Excel workbook.

  2. Select the cell in the Excel worksheet where you want to insert the ADF Table component. When inserting an ADF Table component, you must ensure that the data of two tables do not overlap at runtime.

  3. 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.

  4. 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 to appear in the component at runtime.

    • When you insert an ADF Table component using Insert Binding, then by default, InputText is defined as the subcomponent type for all columns. If you want a column to have a list subcomponent (TreeNodeList or ModelDrivenColumnComponent), then delete the old column and reinsert it with your desired subcomponent type.

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

    Figure 7-2 ADF Table Property Inspector

    Table Component Property Inspector
  6. 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.

  7. 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.


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

    For more information, see Section 7.17, "Limiting the Number of Rows Your Table-Type Component Downloads."

  9. Click OK.

    For more information about the properties that you can set for the ADF Table component, see Section A.9, "ADF Table Component Properties and Actions."

7.3.1 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:

  1. Open the integrated Excel workbook.

  2. Select the cell in the Excel worksheet that references the ADF Table component and click the Edit Component button in the Oracle ADF tab. You can also right-click and select Edit ADF Component Properties from the context menu.

  3. In the the Edit Component: ADF Table dialog, click ellipses button (...) of the Columns property to open the TableColumn Collection Editor dialog. The dialog lists all columns of the selected ADF Table component.

  4. 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 Up and Down arrow keys.

  5. Configure the new column's properties in the right pane of the dialog. For information about ADF Table component properties, see Section A.9, "ADF Table Component Properties and Actions."

  6. Click OK.

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, 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 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 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.

Table 7-2 RowAction properties of ADF Table Component

Property Value

InsertRowEnabled

False

DeleteRowEnabled

False

UpdateRowEnabled

True


7.4.2 What Happens at Runtime When an ADF Table Component Updates Data

When the end user changes data in a row, ADF Desktop Integration marks the row and an upward pointing triangle appears in a row of the _ADF_ChangedColumn column. After updating the existing data, the end user initiates upload process to save the changes. For more information about the ADF Table component's upload process, see Section 7.8, "Configuring an Oracle ADF Component to Upload Changes from an ADF Table Component."

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."

For more information about the properties that you can set for the ADF Table component, see Section A.9, "ADF Table Component Properties and Actions."

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:

  1. Open the project in JDeveloper.

  2. 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.

    For more information, see Section 4.3, "Working with Page Definition Files for an Integrated Excel Workbook" and Section 7.2, "Page Definition Requirements for an ADF Table Component."

  3. Open the integrated Excel workbook.

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

  5. 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.


  6. Configure the BatchOptions properties of the ADF Table component as described in the following table:

    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.


  7. Configure the Columns property of the ADF Table component as described in the following table:

    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.

      For more information about the components that you can use as a subcomponent, see Chapter 6, "Working with ADF Desktop Integration Form-Type Components."

    ID

    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.

    CellStyleName

    Set this property to a style defined in the workbook or to an EL expression that applies a style to the cells in the column at runtime. For more information about styles, see Chapter 9, "Configuring the Appearance of an Integrated Excel Workbook."

    HeaderLabel

    Set this property to a label or to an EL expression that evaluates to a label which is rendered in the column header at runtime. For more information about labels, see Section 9.4, "Using Labels in an Integrated Excel Workbook."

    HeaderStyleName

    Set this property to a style defined in the workbook or to an EL expression that applies a style to the column's header cell at runtime. For more information about styles, see Chapter 9, "Configuring the Appearance of an Integrated Excel Workbook."


  8. Repeat Step 7 for each column that contains data to commit during invocation of the Upload action.

    For information about ADF Table component properties, see Section A.9, "ADF Table Component Properties and Actions."

Note:

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.

7.5.2 How to Insert a New Row in a Polymorphic View Object

If you are using a polymorphic view object and want to insert a new row, you should create a custom method to set the discriminator value to the newly inserted row. The default CreateInsert action binding does not support polymorphic view objects.

Example 7-1 shows the sample code of a custom method used to insert a new row.

Example 7-1 Insert a New Row in a Polymorphic View Object

public void createInsertWithDiscriminator()
{
    AttributeList attrs = new NameValuePairs();
    attrs.setAttribute("<Discriminator_Attribute>", <Discriminator_Value>);
    ViewRowImpl row = (ViewRowImpl)<View_Object>.createAndInitRow(attrs);
    <View_Object>.insertRow (row);
}    

Before implementing the sample code of Example 7-1, replace <Discriminator_Attribute> with the attribute name, <Discriminator_Value> with the discriminator value, and <View_Object> with the view object name.

7.6 Configuring Oracle ADF Component to Download Data to an ADF Table Component

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 ADF Button, a worksheet ribbon button, or a worksheet event 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.

7.6.1 How to Configure an Oracle 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 Oracle ADF component to download data to an ADF Table component:

  1. Open the integrated Excel workbook.

  2. Open the Action Collection Editor 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.

    For more information about invoking action sets, see Section 8.2, "Using Action Sets."

  3. 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-3 shows the Action Collection Editor in the EditPriceList-DT.xlsx workbook where the action set invoked by the worksheet event Startup is configured.

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

    ActionSet Download Data to a Data Entry Grid Component
  4. Click OK.

7.6.2 What Happens at Runtime When an 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 the current state of the 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.

The number of rows that the action downloads depends on the values set for the RowLimit group of properties in the ADF Table component. For more information, see Section 7.17, "Limiting the Number of Rows Your Table-Type Component Downloads."

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

Pre-insert data is data contained in one or more rows of data that you configure an iterator in a Fusion web application to reference. These rows of data have not yet been committed to the Fusion web application's 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, you configure an Oracle ADF component, such as an ADF Button component, a worksheet ribbon button, or a worksheet event 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.

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.

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.

7.7.1 How to Configure a Worksheet to Download Pre-Insert 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 DownloadForInsert action.

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

  1. Open the integrated Excel workbook.

  2. Open the Action Collection Editor 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.

    For more information about invoking action sets, see Section 8.2, "Using Action Sets."

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

  4. Click OK.

7.7.2 What Happens at Runtime When an 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 Oracle ADF Component to Upload Changes from an ADF Table Component

You configure the ADF Table component and the worksheet that hosts it so the 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 attribute, as it changes the selections in the child view object. To prevent any accidental editing, define the ViewLink 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 Oracle ADF Component to Upload Data from an ADF Table Component

Configure an Oracle ADF component, a worksheet ribbon button, a component (a button, for example), or a worksheet event to invoke an action set that, in turn, invokes the ADF Table component Upload action.

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

  1. Open the integrated Excel workbook.

  2. Open the Action Collection Editor to configure the action set that invokes the ADF Table component Upload action.

    For more information about action sets, see Section 8.2, "Using Action Sets."

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

    Figure 7-4 shows the Action Collection Editor in the EditPriceList-DT.xlsx workbook where the action set invoked by the ADF Button labeled Save Changes at runtime is configured.

    Figure 7-4 Action Set Uploading Data from an ADF Table Component

    ActionSet Uploading Data from a Data Entry Grid Component
  4. Click OK.

Note:

The action set does not include a call to a commit-type action as the ADF Table component's batch options already include calls to Commit. For more information, see Section 7.10.1, "Configuring Batch Options for an ADF Table Component."

7.8.2 What Happens at Runtime When an 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:

  1. 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.

  2. 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.

  3. If you did not configure a custom upload dialog for the action set, as described in Section 7.8.5, "How to Create a Custom Upload Dialog," ADF Desktop Integration presents the default upload dialog shown in Figure 7-5.

    Figure 7-5 Default Upload Dialog

    Default Upload Options

    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.

  4. 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:

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

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

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

    4. For each uploaded row, displays a status message in the Status column. For more information, see Section 8.2.5, "How to Display a Status Message While an Action Set Executes."

    5. 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.

  5. 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.

Note:

If an ADF Table component column's ReadOnly property evaluates to True, the ADF Table component's Upload action ignores changes in the column's cells.

For more information about an ADF Table component column's properties, see Table A-10.

7.8.3 What Happens at Runtime When a ReadOnly EL Expression is Evaluated During Upload

At runtime, if an ADF Table component column's ReadOnly property evaluates to True, the ADF Table component's Upload action ignores all changes in the column's cells.

It is recommended that you avoid ReadOnly EL Expressions that specifies row value binding expressions as part of the expression. If a row value binding must be used, you must understand how the EL expression is evaluated during Upload.Currently, all EL expression evaluation is performed on the client. Therefore, an extra round trip to the server would be needed to first evaluate a ReadOnly EL expression containing a row value binding before the row value can be updated. In order to avoid the high cost of making an extra call to the server, ReadOnly EL expression evaluation during upload is performed the same as during table change tracking (as if the user were offline).

For more information about change tracking, see Section 7.19, "Tracking Changes in an ADF Table Component."

7.8.4 What Happens at Runtime When an Upload Fails

When the ADF Table component starts uploading data, ADF Desktop Integration creates a savepoint before initiating the upload process. 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 that is uploaded, ADF Desktop Integration does the following:

  1. Creates a DataControlFrame savepoint on the server.

  2. Applies row attribute value changes, and performs data validation.

  3. In case of any error, reverts back to the savepoint state.

For more information about savepoints, see the "Using Trees to Display Master-Detail Objects" section in the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

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.

To create a custom upload dialog:

  1. Create a page in the JDeveloper project where you develop the Fusion web application. For information on how to create this page, see Section 8.4, "Displaying Web Pages from a Fusion Web Application."

  2. In addition to the ADFdi_CloseWindow element (for example, a span element) described in Section 8.4, "Displaying Web Pages from a Fusion Web Application," the page that you create in Step 1 must include the elements described in Table 7-6.

    Table 7-6 Span Elements Required for Custom Upload

    Name Description

    ADFdi_AbortUploadOnFailure

    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.
  3. 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.

    For more information about displaying pages from a Fusion web application, see Section 8.4, "Displaying Web Pages from a Fusion Web Application."

7.8.6 What Happens at Runtime When a Custom Upload Dialog Appears

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, or if the end user is using the integrated Excel workbook in offline mode, 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.

For more information about displaying a page from the Fusion web application, see Section 8.4, "Displaying Web Pages from a Fusion Web Application." Otherwise, the runtime behavior of the action set that you configure to upload data is as described in Section 7.8.2, "What Happens at Runtime When an ADF Table Component Uploads Data."

7.9 Configuring an ADF Table Component to Delete Rows in the Fusion Web Application

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:

  1. Open your Fusion web application in JDeveloper.

  2. 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.

    For more information, see Section 4.3, "Working with Page Definition Files for an Integrated Excel Workbook."

  3. Open the property inspector for the ADF Table component and set values for the RowActions group of properties as described in Table 7-7.

    Table 7-7 RowActions properties of ADF Table component

    Set this property... To...

    DeleteRowActionID

    The Delete action binding that the page definition file exposes.

    DeleteRowEnabled

    True to enable the ADF Table component to delete rows in the Fusion web application.

    False is the default value.


    For more information about ADF Table component properties, see Section A.9, "ADF Table Component Properties and Actions."

  4. Click OK.

  5. Open the integrated Excel workbook.

  6. Open the Action Collection Editor to configure an action set for the Oracle ADF component, ribbon control, or worksheet event that the end user uses to invoke the action set at runtime.

  7. Add the ADF Table component's DeleteFlaggedRows action to the list of actions that the action set invokes at runtime.

    For more information about invoking action sets, see Section 8.2, "Using Action Sets."

  8. Click OK.

7.9.2 What Happens at Runtime When an ADF Table Component Deletes Rows in a Fusion Web Application

The end user flags rows to delete, as described in Section 7.10.2, "Row Flagging in an ADF Table Component." The end user then invokes the action set. The following sequence of events occurs:

  1. 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.

    For more information about configuring batch options, see Section 7.10, "Batch Processing in an ADF Table Component."

  2. 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.
  3. 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.

  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.

  5. 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.

  6. 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.

Note that 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 happens when any pending model updates that exist when the CommitBatchActionID gets called are not automatically reverted when commit fails.

To avoid any such error, you must 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 rollback 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.10.1 Configuring Batch Options for an ADF Table Component

The ADF Table component has a group of properties (BatchOptions) that allow you to configure how the ADF Table component manages batches of rows. Information about these properties can be found in Section A.9, "ADF Table Component Properties and Actions."

To configure batch options for an ADF Table component:

  1. Open the integrated Excel workbook.

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

  3. 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.


  4. Click OK.

Note that a failure at the Entity level is not considered a batch failure. A failure at commit level (for example, a wrong value for a foreign key attribute) is considered as 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-6 shows an example of a flagged column.

Figure 7-6 Flagged Column in an ADF Table Component

Flagged column in DEG 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.

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.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-7 shows an example.

    Figure 7-7 Changed Column in an ADF Table Component

    Changed column in DEG 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, he or she 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-8 shows an example of Status column message.

    Figure 7-8 Status Column in an ADF Table Component

    Status Column in DEG Component
  • _ADF_RowKeyColumn

    This column, also referred as the Key column, contains important information about the ADF Table component that is 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.

    For more information about the _ADF_RowKeyColumn see Section 7.12, "Configuring ADF Table Component Key Column."

The ADF Table component treats the properties of the _ADF_ChangedColumn, _ADF_FlagColumn, and _ADF_StatusColumn columns differently to 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 Key Column

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

To configure Key column:

  1. Open the integrated Excel workbook.

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

  3. In the Edit Component: ADF Table dialog, click the ellipsis button (...) beside the input field for Columns to invoke the TableColumn Collection Editor.

  4. Select the column with ID as _ADF_RowKeyColumn.

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

    • DynamicColumn

    • InsertComponent

    • InsertUsesUpdate

    • UpdateComponent

    • ID

    • Visible

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

  7. Click OK to close TableColumn Collection Editor.

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

7.12.2 How to Manually Add Key Column At Design Time

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

To manually add key column at design time:

  1. Open the integrated Excel workbook.

  2. 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.

  3. Add a new column in the ADF Table, and specify the properties as described in Table 7-9. For more information about adding a column, see Section 7.3.1, "How to Add a Column in an ADF Table Component.".

    Table 7-9 Key Column Properties

    Set this property... To ...

    CellStyleName

    _ADFDI_TableKeyCellStyle

    HeaderStyleName

    _ADFDI_HeaderStyle

    DynamicColumn

    False

    HeaderLabel

    #{_ADFDIres[COMPONENTS_TABLE_ROWKEY_COL_LABEL]}

    ID

    _ADF_RowKeyColumn

    InsertUsesUpdate

    True

    UpdateComponent

    OutputText

    The Value property must be empty.

    Visible

    True


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

  4. Click OK.

Note:

You must specify the ID property of the new column as _ADF_RowKeyColumn, otherwise the column will not be considered as a Key column, and another Key column would 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.

Note:

You can create a model-driven list of values in your ADF Table component by choosing ModelDrivenColumnComponent as the subcomponent type. For more information about creating a model-driven list, see Section 7.14, "Adding a ModelDrivenColumnComponent Subcomponent to Your ADF Table Component."

For information about the properties of a TreeNodeList subcomponent, see Section A.6, "TreeNodeList Subcomponent Properties."

Figure 7-9 shows the property inspector for an ADF Table component column in AdvEditPriceList-DT.xlsx after TreeNodeList is selected as the subcomponent for the column's UpdateComponent property.

Figure 7-9 ADF Table Component Column Configured to Display a List of Values

Table Component Column to Display a List of Values

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.

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

  1. Open the integrated Excel workbook.

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

  3. In the Edit Component: ADF Table dialog, click the ellipsis button (...) beside the input field for Columns to invoke the TableColumn Collection Editor.

  4. Click Add to add a new column.

  5. Choose the appropriate option for the newly created column:

    • Click the ellipsis button (...) beside the input field for InsertComponent to configure the runtime list of values for insert operations.

    • Click the ellipsis button (...) 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.

  6. Select TreeNodeList and click OK.

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

  8. Click OK.

7.13.2 What Happens at Runtime When a 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-10 shows an example from AdvEditPriceList-DT.xlsx of the Master Price List module where Category is the column configured to display a list of values.

Figure 7-10 Runtime View of an ADF Table Component Column Displaying a List of Values

Table Component Column Displaying a List of Values

7.14 Adding a ModelDrivenColumnComponent Subcomponent to Your ADF Table Component

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. 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.

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.

The ADF Table component's dynamic column supports the following subcomponent types:

  • InputText

  • OutputText

  • ModelDrivenColumnComponent

Note:

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 metadata 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 metadata, 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 When Data Is Downloaded or Uploaded

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, ADF Desktop Integration ignores all attributes with the selected property set to False. On the server side, the JUCtrlHierNodeBinding object determines the attribute list and passes it to the integrated Excel workbook on request.

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:

=IF(#{bindings.TreeID.[TreeNodeID].hints.*.mandatory}, "<prefix_for_mandatory_cols>", "") & "#{bindings.TreeID.[TreeNodeID].hints.*.label}"

For example, the following EL expression adds an asterisk (*) character to the mandatory columns label:

=IF(#{bindings.MyTree.[myapp.model.MyChildNode].hints.*.mandatory}, "* ", "") & "#{bindings.MyTree.[myapp.model.MyChildNode].hints.*.label}"

7.15.4 How to Specify Styles for Dynamic Columns According to Attribute Data Type

You can specify different styles for each data type according to the data type of the column. Use the following syntax to write EL expressions for the CellStyleName property of a dynamic column:

=IF("#{bindings.TreeID.[TreeNodeID].hints.*.dataType}"="<data_type>", <custom_style_expression1>, <custom_style_expression2>)

In the following example, the MyDateStyle style is applied to all date columns, and MyDefaultStyle is applied to other data type columns:

=IF("#{bindings.MyTree.[myapp.model.MyChildNode].hints.*.dataType}"="date", "MyDateStyle", "MyDefaultStyle")

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:

=IF("#{bindings.MyTree.[myapp.model.MyChildNode].hints.*.dataType}"="date", "MyDateStyle", IF("#{bindings.MyTree.[myapp.model.MyChildNode].hints.*.dataType}"="number", "MyNumberStyle", "MyDefaultStyle"))

For more information about EL expressions, see Appendix B, "ADF Desktop Integration EL Expressions."

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."

Figure 7-11 shows the columns that an ADF Read-only Table component which references the ProductList tree binding in the ExcelReadOnlyPageDef.xml page definition file of the Master Price List module renders at runtime.

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

Columns in a Read-only Table Component at run time

Figure 7-12 shows the corresponding view of the same ADF Read-only Table component at design time with the property inspector in the foreground.

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

The Read-only Table component at design time.

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:

  1. Open the integrated Excel workbook.

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

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

  4. 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.
  5. Configure properties in the property inspector that appears to determine the columns to appear and the actions the component invokes at runtime.

  6. 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:

  1. Open the integrated Excel workbook.

  2. Select the cell in the worksheet that hosts the ADF Read-only Table component and click the Edit Component button in the Oracle ADF tab to display the Edit Component: ADF Read-only Table dialog.

  3. Click the ellipsis button (...) beside the input field for Columns to invoke the ReadOnlyColumn Collection Editor.

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

  5. 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.

  6. 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:

  1. Open the integrated Excel workbook.

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

    For more information, see Section 8.2, "Using Action Sets."

  3. Configure properties for the RowLimit group of properties, as described inTable 7-10. For more information about these properties, see Section A.1, "Frequently Used Properties in the ADF Desktop Integration."

    Table 7-10 RowLimit Group of Properties

    Set this property to... This value...

    RowLimit.Enabled

    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.

    The default value also generates a message:

    #{_ADFDIres['ROWLIMIT_WARNINGS_MESSAGE_1']}

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


  4. Click OK.

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

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

The RowLimit attribute group at design time.

7.17.2 What Happens at Runtime When You Limit the Number of Rows a Component Downloads

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-14 appears if you specify an EL expression for RowLimit.MaxRows or do not modify its default value:

#{_ADFDIres['ROWLIMIT_WARNINGS_MESSAGE_1']}

Figure 7-14 Row Limit Exceeded Warning Message

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:

  1. Open the integrated Excel workbook.

  2. Open the Action Collection Editor for the Oracle ADF component that is going to invoke the DoubleClickActionSet at runtime.

    For more information about invoking action sets, see Chapter 8, "Using Action Sets."

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

  4. Click OK.

7.18.2 What Happens at Runtime When 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-15 shows an example.

Figure 7-15 Changed Column in an ADF Table Component

Changed column in DEG 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.8.2, "What Happens at Runtime When an ADF Table Component Uploads Data."

If you write an EL expression for this ReadOnly property that evaluates to True, ADF Desktop Integration evaluates it differently to other EL expressions during change tracking. This is because it is not desirable to invoke a connection to the Fusion web application if the end user makes changes to data in an ADF Table component while working in disconnected mode. Instead, ADF Desktop Integration substitutes an empty string value for any part of an EL expression that requires a connection to the Fusion web application. This behavior also applies to the ADF Table component column's CellStyleName property.

Note:

During change tracking, cell styles are applied when the end user inserts new worksheet rows.

For example, the end user in disconnected mode makes a change to a data value hosted by the ADF Input Text component in an ADF Table component column. During change tracking, ADF Desktop Integration substitutes an empty string value in the parts of the EL expression for the ADF Input Text component's ReadOnly property and the ADF Table component column's CellStyleName property that require a connection to the Fusion web application. For this reason, write EL expression for these properties that evaluate as you intend if an empty string value is substituted for a part of the expression that requires a connection to the Fusion web application to retrieve a runtime value.

The ADF Output Text component does not have a ReadOnly property. Changes that you make to a value hosted by this component, or the ADF Input Text and TreeNodeList subcomponents, do not result in a change to the _ADF_ChangedColumn column.