Home » Oracle ADF » ADF UI: Creating Autosuggest LOV Dinamic

0

I was curious to know if ADF supports autosuggest LOVs just like google search.. getting suggestions as you type in. Now, I found ADF has a nice way to achieve auto-suggest LOVs.  Here is the example workspace.

1. Example UseCase: 

Let us take simple example based on scott schema. Lets say we’re creating a new employee record and we need to enter departement name while creating the employee record. Let’s make DeptName as LOV and implement auto-suggest behavior for the DeptName. i.e., getting the auto-suggested list of values as you type in the department name in the LOV.

2. Implementation Steps:

i. Create two entities on Emp and Dept tables (Lets say they are EmpEO and DeptEO).

ii. Create association between these EmpEO and DeptEO on DeptId.



iii. Create a VO (say EmpDeptVO) joining these two EOs. Make EmpEO as base entity and DeptEO as referenced entity.

iv. Create view accessor in EmpDeptVO on DeptVO and create LOV(Combobox with List of Values) on Dname (which is in referenced entity i.e., DeptEO) attribute in EmpDeptVO.


 


 



v. Drop this attribute as an List of Values -> ADF LOV Choice List into the jsf page. And, set autoSubmit=”true” for the LOV as we need to fetch results from DB for each key-stroke.


vi. Now, select the LOV, right click -> ‘Inser inside’ -> select ‘Auto Suggest Behavior’ and give value for SuggestedItems as “#{bindings.Dname.suggestedItems}”.



The LOV code will be as below:

vii. Now, run the jsf page and you can find the auto-suggest list as you type in the LOV.


Enjoy :) !


Read more:
Oracle ADF – Tips and Techniques: ADF UI: Creating Autosuggest LOV
http://www.adftips.com/2010/10/adf-ui-creating-auto-suggest-lov.html#ixzz1dxaSgrr3

Share

Leave a Reply

You must be Logged in to post comment.

office automation book