Creating new object in list (inputListOfValues) using ‘createPopupId’ feature- ADF 11g & 12c

Sharing is Caring

Hello All,
This post is about a good feature provided with inputListOfValues in ADF.
inputListOfValues is used where large and complex data is populated in the list, this component supports search in list values
Suppose on opening list values you want to add one more value in list generally to do that you will  close the list and add a value in source table then again open list but this feature provides instant creation of list values

this functionality can be achieved in Combo Box with List of Values using customActions facet, I have posted about it
Create new lookup data using List of Values (LOVs) in Oracle ADF

so this time it is about af:inputListOfValues, see the steps to do

  • Created a fusion web application and business components using Departments and Employees table of HR Schema

 

  • I have created a list of values on DepartmentId of Employees ViewObject referenced from Department ViewObject, display type is Input Text with List of Values
inputListOfValues
  •  Drop Employees VO on the page and run, it looks like this

 

  • Now I have dropped a popup on the page and to create new value in the list, I have dropped form of Departments ViewObject and a link to create it on dialog inside the popup

 

  • Select list of values component (Employee VO) in structure window and go to property inspector and set popUp id in a property called ‘createPopupId’
  • After setting ‘createPopupId’, on running a commandToolbarButton appears in the LOV popup dialog box with an icon, this button’s action triggers custom popUp (i have added before)

on clicking on this icon-

 

  •  On create link I have just called createInsert for Departments ViewObject and on dialogListener, Execute
import oracle.adf.model.BindingContext;
import oracle.binding.BindingContainer;
import oracle.binding.OperationBinding;

/**Method to get Bindings of current page
 * @return
 */
public BindingContainer getBindings(){
return BindingContext.getCurrent().getCurrentBindingsEntry();
}

/**Method to execute OperationBinding
 * @param operation
 * @return
 */
public OperationBinding executeOperation(String operation){
return getBindings().getOperationBinding(operation);
}

/**Method to create new Department
 * @param actionEvent
 */
public void createDeptAction(ActionEvent actionEvent) {
executeOperation("CreateInsert").execute();
}

 

  • Now created a new department using ‘create’ link and you can see value appears in list values

 

Cheers 🙂 Happy Learning

Related Posts

An Oracle ACE, Blogger, Reviewer, Technical Lead working on Oracle ADF

Leave a Reply

Your email address will not be published. Required fields are marked *