Sunday, September 1, 2013

List of Values/ Dependant List of Values

Suppose for employees table we want to create a list of values for the departmentId so that the user can select from the pre-existing set of drop down values and the various departments are available in the Department table.

-> create an EO and a VO for the employees
-> create an EO and a VO for the departments
-> In the EmplyeesViewObject.xml select the departmentId attribute in the Attributes section and add a new list of values. Select the List data source i.e., the VO from which we want to populate the list of values and the corresponding List attribute. This completes the creation of a list of values to the departmentId which come from the departmentsVO in the employeesVO

The above procedure is the same for creating dependant list of values. The query which populates the ManagerId should actually give the managerId straight away from the entered departmentId. For this create a VO which has a bind parameter (bindDepartmentId).

-> Initially for the ManagerId create a list of values with the above query.
-> Next step would be setting the bindDepartmentId to the departmentId.
-> In the View Accessors section click on the edit button of the VO. For the bind parameter set the value to      the DepartmentId which is the attribute from the EmployeesVO 

No comments:

Post a Comment