Custom Upload options in ADF Desktop Integration

About

     In ADFdi enabled excel workbook while uploading the changes performed in ADF Table,standard upload options dialog appears like below.

uploadoptions_dialog.PNG

    In this article,we will see how to customize these options in a dialog.

Usecase

     Let us take a simple example of Employee table.

Implementation

Assumption: An ADF Web Application with ADF Desktop Integration enabled workbook having Employee table as below screenshot is available.

adfdi1_table.PNG


Now let's create a new jspx page titled 'UploadOptions.jspx'.
The below code adds two checkboxes and buttons.Let's copy this into the Source view of jspx page.

<!-- Check box for AbortUploadOnFailure -->
<af:selectBooleanCheckbox text="Abort Upload On Failure" id="sbc1"
  value="#{requestScope.abortUploadOnFailure}" autoSubmit="true" selected="true"/>

<!--Check box for DownloadAfterUpload -->
<af:selectBooleanCheckbox text="Download After Upload" id="sbc2" autoSubmit="true"
  value="#{requestScope.downloadAfterUpload}"/>

<!--Command button for Continue action -->
<af:button text="Continue" id="b1" inlineStyle="width:100px;" partialSubmit="false">
<af:setActionListener from="continue" to="#{requestScope.action}"/>
</af:button>

<!-- Command button for Abort action -->
<af:button text="Abort" id="b2" inlineStyle="width:100px;" partialSubmit="false">
<af:setActionListener from="abort" to="#{requestScope.action}" />
</af:button>


The UploadOptions.jspx page now looks like below:

custom_upload_jspx.PNG

Below Span elements have to be used to perform custom upload actions in ADFdi Table.

ADFdiCloseWindow - When a web page has to be closed,this span element can be set to
Continue  - to close the web page and invoke next action in actions set or
Abort       - to close the web page and terminate the action set.
ADFdiAbortUploadOnFailure - If this element is set 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.
ADFdiDownloadAfterUpload - If this element is set to True, the action set downloads data into the ADFdi Table component after the action set uploads modified data.

Let us add the below code at the end of tag Form in source view of jspx,to include the above mentioned span elements.

<!-- Closes the Upload Options dialog and then invokes next action in the action set-->
<f:verbatim rendered="#{requestScope.action eq 'continue'}">
<span id="ADFdiCloseWindow">Continue</span>
</f:verbatim>


<!-- Closes the
Upload Options dialog but aborts next actions in action set-->
<f:verbatim rendered="#{requestScope eq 'abort'}">
<span id="ADFdi
CloseWindow">Abort</span>
</f:verbatim>


<!-- If the span element is set to
  True, the action set stops uploading if it encounters a failure.
  False, the action set attempts to upload all rows and indicates if each row succeeded or failed to upload. -->
<f:verbatim>
<span id="ADFdiAbortUploadOnFailure">${requestScope.abortUploadOnFailure}</span> 
</f:verbatim> 


<!--If the span element is set to
True, the action set downloads data from the Fusion web application to the ADF Table after the action set uploads modified data -->
<f:verbatim>
<span id="ADFdi
DownloadAfterUpload">${requestScope.downloadAfterUpload}</span>
</f:verbatim>


In ADFdi excel workbook,let us add this new jspx file as dialog before Table.Upload action in Ribbon Commands of Worksheet Properties.

worksheet_properties.PNG

Now we run the excel workbook and download data into ADF Table as shown above.Let's update a row by changing the Sal=4000 of Martin.

update2_ADFdiTable.PNG

On clicking Upload Ribbon command like below:

Uplaod_ribbon.PNG

the custom upload actions dialog gets opened with 'Abort Upload On Failure' check box selected by default.

custom1_upload_workbook.PNG
We can select 'Download After Upload' check box and click on Continue button.We can see data updated and downloaded again with new value like below:

updated2_table.PNG

This is a simple example of how upload options can be customized. Using this, we can add more custom options to the dialog, which is not available in the standard upload options dialog. We will see such options sooner in my next blog.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Tips and Tricks from Oracle's JDeveloper & ADF QA

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today