How to Programatically Invoke a Popup

Using Popup Dialogs, Menus, and Windows 13-19 The code in Example 13–10 tells ADF Faces to align the popup contents with the commandButton that is identified by the id button, and to use the alignment position of afterEnd, which aligns the popup element underneath the button, as shown in Figure 13–5 . Figure 13–5 Button and Popup Contents

13.5 Displaying Contextual Information

There may be cases when you think the user may need more information to complete a task on a page, but you don’t want to clutter the page with information that may not be needed each time the page is accessed, or with multiple buttons that might launch dialogs to display information. While you could put the information in a popup element that was launched with a right-click on a component, the user would have no way of knowing the information was available in a popup. The contextInfo component allows you to display additional information in a popup element and also notifies users that additional information is available. When you place the contextInfo component into the context facet of a component that supports contextual information, a small orange square is shown in the upper left-hand corner of the component, as shown in Figure 13–6 . Figure 13–6 contextInfo Displays a Square When the user places the cursor over the square, a larger triangle with a note icon and tooltip is displayed, indicating that additional information is available, as shown in Figure 13–7 Figure 13–7 contextInfo Component Indicates Additional Information Is Available Because a showPopupBehavior tag is a child to the contextInfo component, the referenced popup will display when the user clicks the information icon, as shown in Figure 13–8 . 13-20 Web User Interface Developers Guide for Oracle Application Development Framework Figure 13–8 Dialog launched From contextInfo Component

13.5.1 How to Create Contextual Information

You use the showPopupBehavior component as a child to the contextInfo component, which allows the popup component to align with the component that contains the contextInfo component. Before you begin: 1. Create the component that will be the parent to the contextInfo component. The following components support the contextInfo component: ■ column ■ commandLink ■ inputComboboxListOfValues ■ inputListOfValues ■ inputText ■ outputFormatted ■ outputText ■ selectOneChoice 2. Create the popup element to display, as documented in Section 13.2, Declaratively Creating Popup Elements. To use a contextInfo component: 1. In the Component Palette, from the Common Components panel, drag a Context Info and drop it into the Context facet of the component that is to display the additional information icons.

2. If you need server-side logic to execute when the contextInfo component

displays, bind the contextInfoListener attribute to a handler that can handle the event. Tip: If the facet is not visible in the visual editor: 1. Right-click the outputText component in the Structure window. 2. From the context menu, choose Facets - component name Context. Facets in use on the page are indicated by a checkmark in front of the facet name.