What You May Need to Know About Accessing Selected Values

Using List-of-Values Components 11-3 and programmatically set it with a value when the user selects an item from the Search and Select dialog and then closes the dialog. This value will be the return value from ReturnPopupEvent to the returnPopupListener. When you implement the returnPopupListener, you can perform functions such as setting the value of the LOV component, its dependent components, and displaying the custom content. In the searchContent facet you can add components such as tables, trees, and inputText to display your custom content. If you implement both the searchContent facet and the ListOfValues model, the searchContent facet implementation will take precedence in rendering the Search and Select dialog. Example 11–1 show the code to display custom content using a table component. Example 11–1 Adding Custom Content to the Search and Select Dialog af:inputListOfValues model={bean.listOfValuesModel} ... returnPopupDataValue={bean.returnPopupDataValue} returnPopupListener={bean.returnPopupListener} f:facet name=searchContent af:table id=t1 value={bean.listModel} var=row selectionListener={bean.selected} ... f:facet af:inputListOfValues If the readOnly attribute is set to true, the input field is disabled. If readOnly is set to false, then the editMode attribute determines which type of input is allowed. If editMode is set to select, the value can be entered only by selecting from the list. If editMode is set to input, then the value can also be entered by typing. You can also implement the LOV component to automatically display a list of suggested items when the user types in a partial value. For example, when the user enters Ca, then a suggested list which partially matches Ca is displayed as a suggested items list, as shown in Figure 11–4 . Figure 11–4 Suggested Items List for an LOV The user can select an item from this list to enter it into the input field, as shown in Figure 11–5 . Figure 11–5 Suggested Items Selected 11-4 Web User Interface Developers Guide for Oracle Application Development Framework You add the auto suggest behavior by adding the af:autoSuggestBehavior tag inside the LOV component with the tag’s suggestItems values set to a method that retrieves and displays the list. You can create this method in a managed bean. If you are using ADF Model, the method is implemented by default. You also need to set the component’s autoSubmit property to true. In your LOV model implementation, you can implement a smart list that filters the list further. You can implement a smart list for both LOV components. If you are using ADF Model, the inputComboboxListOfValues allows you declaratively select a smart list filter defined as a view criteria for that LOV. If the smart list is implemented, and auto suggest behavior is also used, auto suggest will search from the smart list first. If the user waits for two seconds without a gesture, auto suggest will also search from the full list and append the results. The maxSuggestedItems attribute specifies the number of items to return -1 indicates a complete list. If maxSuggestedItems

0, a More link is rendered for the user to click to launch the LOV’s Search and Select dialog.

Example 11–2 shows the code for an LOV component with both auto suggest behavior and smart list. Example 11–2 Auto Suggest Behavior and Smart List af:autoSuggestBehavior suggestItems={bean.suggestItems} smartList={bean.smartList} maxSuggestedItems=7 Figure 11–6 shows how a list can be displayed by an inputComboboxListOfValues component. If the popup dialog includes a query panel, then a Search link is displayed at the bottom of the dropdown list. If a query panel is not used, a More link is displayed. Figure 11–6 InputComboboxListOfValues Displays a List of Employee Names The dropdown list of the inputComboboxListOfValues component can display the following: ■ Full list: As shown in Figure 11–6 , a complete list of items returned by the ListOfValuesModel.getItems method. ■ Favorites list: A list of recently selected items returned by the ListOfValuesModel.getRecentItems method. ■ Search link: A link that opens a popup Search and Select dialog. The link is not on the scrollable region on the dropdown list.