Jul 25, 2012

Auto Suggest Behavior


The 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. 

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.


Drag the FirstName attribute is displayed as an inputListOfValues











Now drag and drop the autoSuggestBehavior from your component palette inside of List.



 Then Add   SuggestedItems Property Auto Suggest Behavior.








Add EL in  SuggestedItems.......
 

















 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Now run your page and now you will get auto suggest items as you type.
Here are two different types of lists:

                                                              ADF LOV Input

                                                                ADF LOV Choice List

1 comment:

  1. How do you change the "No results Found." text to something else. This should come from a resource bundle but I haven't found how to change it on this component.

    ReplyDelete