Preparing an Object to Invoke a Thin Dialog

In a BI Beans servlet application, you must provide a way to invoke any thin dialogs that you include. In a JSP application, you use the DialogLink tag to invoke most dialog pages; for a Save Confirmation dialog, you use a SaveButton JSP tag. In a UIX application, you use a dialogLinkDef element for most dialogs, and a SaveDef element for a Save Confirmation dialog. As the UINode in a UIX application you can use a UIX link element or UIX button element.

In a servlet, you normally create a button or a hyperlink that a user will click to display the dialog page. This is necessary for thin dialogs other than the Find Member dialog or for the Printer-Friendly View. For the Find Member dialog, you need only to set an event target on the thin presentation bean. For the Printer-Friendly View, you set an event target on the Print Options dialog. For other thin dialogs, you should prepare a button or hyperlink to invoke the thin dialog.

To have the button or hyperlink signal that you should display a thin dialog page, you set the button or hyperlink to trigger an initialization event. The InitEventDataObject makes it easier to do this.

To trigger an initialization event:

  1. Create an EventTarget. If the thin dialog is stored in the browser session, then set the name of the thin dialog as the thinBeanTarget parameter. If you will instantiate the thin dialog in response to the BIConstants.INIT_EVENT, then pass a String that identifies the thin dialog that you want to create.

    Call the setExtraParameters method to pass necessary information from the calling page to the thin dialog page. For example, you use extra parameters to pass the view name or its persistable attributes to the thin dialog page.

  2. Set the EventTarget on an InitEventDataObject, to direct initialization events to thin dialogs. The InitEventDataObject is defined in oracle.dss.thin.beans package.

  3. Set up the hyperlink or button to pick up the InitEventDataObject as a bound data value. The hyperlink or button will appear on the page from which users will invoke the thin dialog page.

  4. Set the data object on the rendering context.

Example: Setting up the InitDataEventObject and the BoundDataValue

The following example shows how to set up an InitDataEventObject for an ExportOptions dialog that has been stored in a browser session. This code assumes that a ButtonBean named initButtonBean is the same HTML page as a thin crosstab that is named "MyCrosstab". It also assumes that an ExportOptions named myExportOptionDialog is stored in the browser session.


// set up the view name as extra parameters on the EventTarget Dictionary optionParams = new Hashtable(); optionParams.put("ViewName", "MyCrosstab"); // create the EventTarget -- assumes myExportOptionDialog is stored in the session EventTarget target = new EventTargetImpl("myExportOptionDialog", optionParams); // if you will create the ExportOptions in response to INIT_EVENT, // then pass a String that you will look for as the source later // the example in this topic would look for "exportOptions" as in this call: // EventTarget target = new EventTargetImpl("exportOptions", optionParams); // create the InitEventDataObject InitEventDataObject initEventObject = new InitEventDataObject(target); // set the object on the rendering context context.setDataObject("MyNamespace","MyInitDataObject", initEventObject); // create a bound data value DataBoundValue value = new DataBoundValue("MyNamespace", "MyInitDataObject",""); // set the bound data value as the value of the on-click attribute initButtonBean.setAttributeValue(ButtonBean.ON_CLICK_ATTR,value); // then, add the button bean to the HTML page that will be rendered; // code not included in this example

For more information on bound data values, see the UIX documentation.