How to Add the Query Component

13-2 Web User Interface Developers Guide for Oracle Application Development Framework small square. When moused over, the icon grows and also displays a note icon as shown in Figure 13–2 . Figure 13–2 With Mouseover, Larger Icon with Note is Displayed When the user clicks the note icon, the associated popup displays its enclosed content. ADF Faces also provides a dialog framework to support building pages for a process displayed separate from the parent page. This framework supports multiple dialog pages with a control flow of their own. For example, say a user is checking out of a web site after selecting a purchase and decides to sign up for a new credit card before completing the checkout. The credit card transaction could be launched using the dialog framework in an external browser window. The completion of the credit card transaction does not close the checkout transaction on the original page. This dialog framework can also be used inline as part of the parent page. This can be useful when you want the pages to have a control flow of their own, but you don’t want the external window blocked by popup blockers. If your application uses the full Fusion technology stack, note that this dialog framework is integrated with ADF Faces Controller for use with ADF task flows. For more information, see the Running a Bounded Task Flow in a Modal Dialog section in the Oracle Fusion Middleware Fusion Developers Guide for Oracle Application Development Framework.

13.2 Declaratively Creating Popup Elements

The dialog, panelWindow, menu, and noteWindow components can all be used inside the popup component to display inline popup elements, as shown in Table 13–1 . When no child component exists for the popup component, a very simple inline popup is displayed. Table 13–1 Components Used with the popup Component Component Displays at Runtime dialog Displays its children inside a dialog and delivers events when the OK, Yes, No, and Cancel actions are activated. For more information, see Section 13.2.1, How to Create a Dialog. Using Popup Dialogs, Menus, and Windows 13-3 Both the dialog and panelWindow components support definition help, content displayed when a user moves the cursor over a help icon a blue circle with a question mark. For more information, see Section 17.5, Displaying Help for Components. Typically, you use a command component in conjunction with the showPopupBehavior tag to launch a popup element. You associate the showPopupBehavior tag with the component it should launch. This tag also controls the positioning of the popup element when needed. In addition to being used with action events on command components, the showPopupBehavior tag can be used in conjunction with other events, such as the showDetail event and the selection event. For more information, see Section 13.4, Invoking Popup Elements. panelWindow Displays its children in a window that is similar to a dialog, but does not support events. For more information, see Section 13.2.2, How to Create a Panel Window. menu Displays a context menu for an associated component. For more information, see Section 13.2.3, How to Create a Context Menu. noteWindow Displays read-only information associated with a particular UI component. Note windows are used to display help and messages and are commonly shown on mouseover or on focus gestures. For more information, see Section 13.2.4, How to Create a Note Window. popup component without a parent component Displays content inline. Table 13–1 Cont. Components Used with the popup Component Component Displays at Runtime 13-4 Web User Interface Developers Guide for Oracle Application Development Framework By default, the content of the popup element is not sent from the server until the popup element is displayed. This represents a trade-off between the speed of showing the popup element when it is opened and the speed of rendering the parent page. Once the popup element is loaded, by default the content will be cached on the client for rapid display. You can modify this content delivery strategy by setting the contentDelivery attribute on the popup component to one of the following options: ■ lazy - The default strategy previously described. The content is not loaded until you show the popup element once, after which it is cached. ■ immediate - The content is loaded onto the page immediately, allowing the content to be displayed as rapidly as possible. Use this strategy for popup elements that are consistently used by all users every time they use the page. ■ lazyUncached - The content is not loaded until the popup element is displayed, and then the content is reloaded every time you show the popup element. Use this strategy if the popup element shows data that can become stale or outdated. If you choose to set the popup component’s contentDelivery attribute to lazy or lazyUncached, you can further optimize the performance of the popup component and the page that hosts it by setting another popup component attribute childCreation to deferred. This defers the creation of the popup components child components until the application delivers the content. The default value for the childCreation attribute is immediate.

13.2.1 How to Create a Dialog

Create a dialog when you need the dialog to raise events when dismissed. Once you add the dialog component as a child to the popup component, you can add other components to display and collect data. By default, the dialog component can have the following combination of buttons: ■ Cancel ■ OK ■ OK and Cancel ■ Yes and No ■ Yes, No, and Cancel ■ None These buttons launch a dialogEvent when clicked. You can add other buttons to a dialog using the buttonBar facet. Any buttons that you add do not invoke the dialogEvent. Instead, they invoke the standard actionEvent. It is recommended that any of these buttons that you add have their partialSubmit attribute set to true. This makes sure that an actionEvent invokes only on components within the dialog. However, you can add buttons and set their partialSubmit attribute to false if you set the af:popup component’s autoCancel property’s value to disabled. Choosing this latter option partialSubmit set to false results in increased wait times for end users because your application reloads the page and reinitializes components on the page before it restores the popup component’s visibility and by extension, the dialog component. Note that you must set the command component’s partialSubmit attribute to true if the af:popup component’s autoCancel property’s value is set to enabled the default value. For more information about the use of the af:popup component’s autoCancel property, see Section 13.6, Controlling the Automatic Cancellation of Inline Popups.