How to Configure the Page Definition File for the Worksheet to Receive Parameters

Deploying Your Integrated Excel Workbook 14-7

4. Optionally, expand the Behavior section and specify component IDs for the

partialTriggers property that, when invoked, update the values of the af:goLink tag and its Destination property. For example, if you have navigation buttons with the IDs NextButton, PreviousButton, FirstButton, and LastButton, specify them as follows: :NextButton :PreviousButton :FirstButton :LastButton 5. Save the page. The following example shows the entries that JDeveloper generates in a JSF page using the examples in this procedure: af:goLink text=Download to Excel destination=excelworkbook.xlsx?productName={bindings.productName.attributeV alue} partialTriggers=:NextButton :PreviousButton :FirstButton :LastButton

14.5.2 How to Configure the Page Definition File for the Worksheet to Receive Parameters

You configure the page definition file associated with the worksheet in the integrated Excel workbook as follows: ■ Add one or more parameter elements that initialize the worksheet with the values specified by the workbook Parameters property that you configure in Section 14.5.3, How to Configure Parameters Properties in the Integrated Excel Workbook. The following example shows a parameter element in a page definition file that is associated with a worksheet in an integrated Excel workbook: parameters Destination Invoke the expression builder to write an EL expression that specifies the integrated Excel workbook and the values to download as a URL argument: For example, write an EL expression such as the following: excelworkbook.xlsx?productName={bindings.pr oductName.attributeValue} Note that the runtime URL-encoded value of the EL expression to the right of ? must be less than 2048 bytes. If the runtime value exceeds 2048 bytes, the integrated Excel workbook downloads the URL arguments in the first 2048 bytes. Subsequent URL arguments do not get downloaded to the integrated Excel workbook. Instead, the Fusion web application writes log entries for these URL arguments identifying them as having not been downloaded. For example, the runtime URL-encoded value of productName={bindings.productName.attributeVal ue} must be less than 2048 bytes. Also note that if the URL contains more than 256 characters, an exception is raised when the end user downloads and opens the integrated Excel workbook without saving it. To resolve this problem, you must limit your URL length to 256 characters, or instruct the end user to save the workbook before opening it. Table 14–1 Cont. Properties for af:goLink Tag Property Value 14-8 Desktop Integration Developers Guide for Oracle Application Development Framework parameter id=ProductNameParam parameters ■ Add an invokeAction and a method action binding so that the page definition file associated with the worksheet initializes correctly. The following example shows the initializeProductTable invokeAction invoking the filterByProductName method action binding. The invokeAction is refreshed only when a value for ProductNameParam is supplied. executables invokeAction Binds=filterByProductName id=initializeProductTable Refresh=deferred RefreshCondition={bindings.ProductNameParam = null} ... executables The method action binding invokes a view object method filterByProductName. The view object method takes a single String argument ProductNameArg that references the value of ProductNameParam. bindings methodAction id=filterByProductName RequiresUpdateModel=true Action=invokeMethod MethodName=filterByProductName IsViewObjectMethod=true DataControl=AppModuleDataControl InstanceName=AppModuleDataControl.ProductVO1 NamedData NDName=ProductNameArg NDValue={bindings.ProductNameParam} NDType=java.lang.String methodAction . . . bindings For more information about configuring a page definition file, see Section 4.3, Working with Page Definition Files for an Integrated Excel Workbook.

14.5.3 How to Configure Parameters Properties in the Integrated Excel Workbook