Developer Tools
JDeveloper
ADF Faces RC: Working with the AutoSuggest BehaviorAn Oracle JDeveloper How To Document
The AutoSuggest Behavior in ADF 11gThe af:autoSuggestBehavior is a new tag from the ADF Faces RC part of the ADF 11g PS1 release. This article explains how input components and list of values can adapt auto-suggest style functionality. IntroductionThe af:autoSuggestBehavior produces a dropdown list of suggested items as the user types into the input component. This functionality is implemented as a behavior which means it is a sub-element that needs to be inserted into a top-level component tag. Let’s use our Employees table on the HR schema to create an employee entry form. To use the auto-suggest functionality in a declarative way you need to define a model-driven list of values on your model project, which will be the base for the suggestedItems list. Select the FirstName attribute from the Employees VO and create a List of Values. Create List of Values Create List of Values On the UI Hints Tab,select the Default Display to be Input Text with List of Values. Create List of Values Now we can work on the UI. Implementing the UIDrag and drop the Employee collection to an empty page to create an input form Create an Input Form The FirstName attribute is displayed as an inputListOfValues, although all we need is to have any kind of input text. Now drag and drop the autoSuggestBehavior from your component palette inside of List. Drag and Drop Auto Suggest Behavior Then you are prompted to enter the suggestedItems list. The suggestedItems attribute needs to be bounded to a method with signature List<javax.faces.model.SelectItem>, although for model-driven list we have added the suggestItems property to the list bindings on the ADFm -you can then access the suggest list of items via EL. Suggested Items List The source code of your page then is
Source Code
Run the Page
<h3>Where to get more information</h3>
|