While working on project , I have seen such type of LOV that have a option of create Lov Value at selection time, this is quite good, as if desired value is not available in list then user can create on that time.
This type of list looks like this
It means if there is no company available in list you need not to go on Company form, user can create it directly from here.
Doing this in ADF is quite simple , in this tutorial i am taking example of Oracle default HR schema (Employees and Departments) table-
- Create business components from Department and Employees table
- Now create LOV on DepartmentId of employees ViewObject from Department VO
- Go to UI Hints tab of LOV and select Combo Box with List of Values
- Now drag fields of Employee from DataControl to page as form
- Select Department Id Lov and go to structure window, and drop a link in customActions facet of af:inputComboboxListOfValues
- Now drag a popup on page and drag Department VO on af:dialog as form to create new department. and other things are same as normal form
- Bind this popup to bean and create a ActionListener on the link inside facet to invoke createInsert of department table
- Now run this application and click on Lov of DepartmentId, you will see your link there to create Department
- Now see that how many departments are listed currently in LOV
- Now click on Add Department link and add a department
- Again see the listed departments- Oracle ADF Tutorial is added in now list
Sample ADF Application- Download