Creating the ListOfValues Data Model

Using List-of-Values Components 11-9 ■ value : Enter an EL expression that resolves to the attribute values used to populate the list, as created in Section 11.2, Creating the ListOfValues Data Model.

3. Expand the Appearance section and set the following attribute values:

■ popupTitle : Specify the title of the Search and Select popup dialog. ■ searchDesc : Enter text to display as a mouseover tip for the component. The rest of the attributes in this section can be populated in the same manner as any other input component. For more information, see Section 9.3, Using the inputText Component.

4. Expand the Behavior section and set the following attribute values:

■ autoSubmit : Set to true if you want the component to automatically submit the enclosing form when an appropriate action takes place a click, text change, and so on. This will allow the auto-complete feature to work. If you are adding the auto suggest behavior, you must set autoSubmit to true. ■ createPopupId : If you have implemented a popup dialog used to create a new object in the list, specify the ID of that popup component. Doing so will display a toolbar component above the table that contains a commandToolbarButton component bound to the popup dialog you defined. If you have added a dialog to the popup, then it will intelligently decide when to refresh the table. If you have not added a dialog to the popup, then the table will be always refreshed. ■ launchPopupListener : Enter an EL expression that resolves to a launchPopupListener that you implement to provide additional functionality when the popup is launched. ■ returnPopupListener : Enter an EL expression that resolves to a returnPopupListener component that you implement to provide additional functionality when the value is returned. The rest of the attributes in this section can be populated in the same manner as any other input component. For more information, see Section 9.3, Using the inputText Component. 5. If you want users to be able to create a new item, create a popup dialog with the ID given in Step 4. For more information, see Chapter 13, Using Popup Dialogs, Menus, and Windows.

6. In the Component Palette, from the Operations panel, drag an Auto Suggest

Behavior and drop it as a child to the inputListOfValues component. 7. In the Property Inspector, for each of the auto suggest attributes, enter the: ■ EL expression that resolves to the suggestItems method. The method should return Listjavax.model.SelectItem of the suggestItems. The method signature should be of the form Listjavax.model.SelectItem suggestItemsjavax.faces.context.FacesContext, oracle.adf.view.rich.model.AutoSuggestUIHints ■ EL expression that resolves to the smartList method. The method should return Listjavax.model.SelectItem of the smart list items. ■ number of items to be displayed in the auto suggest list. Enter -1 to display the complete list. 11-10 Web User Interface Developers Guide for Oracle Application Development Framework If you are implementing this method in a managed bean, the JSF page entry should have the format shown in Example 11–3 Example 11–3 autoSuggestBehavior Tag in an LOV af:inputListOfValues value={bean.value} id=inputId ... af:autoSuggestBehavior suggestItems={bean.suggestItems} smartList={bean.smartList} maxSuggestedItems=7 af:inputListOfValues If the component is being used with a data model such as ADF Model, the suggestItem method should be provided by the default implementation. 8. If you are not using ADF Model, create the suggestItems method to process and display the list. The suggestItems method signature is shown in Example 11–4 . Example 11–4 suggestItems Method Signature Listjavax.model.SelectItem suggestItemsjavax.faces.context.FacesContext, oracle.adf.view.rich.model.AutoSuggestUIHints

11.4 Using the InputComboboxListOfValues Component

The inputComboboxListOfValues component allows a user to select a value from a dropdown list and populate the LOV field, and possibly other fields, on a page, similar to the inputListOfValues component. However, it also allows users to view the values in the list either as a complete list, or by most recently viewed. You can also configure the component to perform a search in a popup dialog, as long as you have implemented the query APIs, as documented in Section 11.2, Creating the ListOfValues Data Model. Before you begin: You should already have a created a page or page fragment. To add an inputComboboxListOfValues component: 1. In the Component Palette, from the Common panel, drag an Input Combobox List Of Values and drop it onto the page.

2. In the Property Inspector, expand the Common section and set the following

attributes: ■ model : Enter an EL expression that resolves to your ListOfValuesModel implementation, as created in Section 11.2, Creating the ListOfValues Data Model. ■ value : Enter an EL expression that resolves to the attribute values used to populate the list, as created in Section 11.2, Creating the ListOfValues Data Model.

3. Expand the Appearance section and set the following attribute values:

■ popupTitle : Specify the title of the Search and Select popup dialog. ■ searchDesc : Enter text to display as a mouseover tip for the component. Using List-of-Values Components 11-11 The rest of the attributes in this section can be populated in the same manner as any other input component. For more information, see Section 9.3, Using the inputText Component.

4. Expand the Behavior section and set the following attribute values:

■ autoSubmit : Set to true if you want the component to automatically submit the enclosing form when an appropriate action takes place a click, text change, and so on. This will allow the auto complete feature to work. If you are adding the auto-suggest behavior, you must set autoSubmit to true. ■ createPopupId : If you have implemented a popup dialog used to create a new object in the list, specify the ID of that popup component. Doing so will display a toolbar component above the table that contains a commandToolbarButton component bound to the dialog you defined. If you have added a dialog to the popup, then it will intelligently decide when to refresh the table. If you have not added a dialog to the popup, then the table will always be refreshed. ■ launchPopupListener : Enter an EL expression that resolves to a launchPopupListener handler that you implement to provide additional functionality when the popup dialog is opened. ■ returnPopupListener : Enter an EL expression that resolves to a returnPopupListener handler that you implement to provide additional functionality when the value is returned. The rest of the attributes in this section can be populated in the same manner as any other input component. For more information, see Section 9.3, Using the inputText Component. 5. If you are using a launchPopupListener, you can use the getPopupType method of the LaunchPopupEvent class to differentiate the source of the event. getPopupType returns DROPDOWN_LIST if the event is a result of the launch of the LOV Search and Select dialog, and SEARCH_DIALOG if the event is the result of the user clicking the Search button in the dialog. 6. If you want users to be able to create a new item, create a popup dialog with the ID given in Step 5. For more information, see Chapter 13, Using Popup Dialogs, Menus, and Windows.

7. In the Component Palette, from the Operations panel, drag an Auto Suggest

Behavior and drop it as child to the inputComboboxListOfValues component. 8. In the Property Inspector, for each of the auto suggest attributes, enter the: ■ EL expression that resolves to the suggestItems method. The method should return Listjavax.model.SelectItem of the suggestItems. The method signature should be of the form Listjavax.model.SelectItem suggestItemsjavax.faces.context.FacesContext, oracle.adf.view.rich.model.AutoSuggestUIHints ■ EL expression that resolves to the smartList method. The method should return Listjavax.model.SelectItem of the smart list items. ■ number of items to be displayed in the auto suggest list. Enter -1 to display the complete list. If you are implementing this method in a managed bean, the JSF page entry should have the format shown in Example 11–5 .