Tuesday 1 February 2011

Showing Data Based on List Of Values And Bind Variables

 Create one Fusion Web Application with Model and View Controller projects.

Create ADF Businesss Components.

Like below I have created,

One HRApplication is created with HRModel and HRViewController projects.

Then created the entities(Employees, Departments) from Employees and Departments tables.



Then created the updatable view objects.(EmployeesViewObject,DepartmentsViewObject).



Then created the Application Module (HRAppModule)


Now click finish to complete the Business components.

Now I should create the view criteria to create the criteria and create the bind variable to pass the selected data from list of values.

First Create the List Of Values to be displayed in criteria.

I am creating it to show employees present in one department.

To do that

First open the EmployeesViewObject.xml in "Overview" mode.

Go to the Attributes page.

Only Employees entity's attributes are being shown there.

To display the Departments entity's attribute . Go to "Entity Objects" option. Add the Departments entity object on right side.


Now come to "Attributes" section again.

Right click the down arrow beside the green add button as shown in the picture.

Choose option Add Attribute From Entity



Chhose all the Deaprtments' Attributes.

Now Select the DepartmentName attribute.

Click the Green Add Button related to List Of Values:DepartmentName as shown in picture.



Choose the List Of Values properties.



Now go to "Query" portion to create the view criteria.



Now your business components are ready



Now Go to HRViewController project.

Create one jspx page from JSF> JSF Page


Now refresh the Data Control Pane.



Drag the EmployeesViewObjectCriteria in page's center region.

Choose Query> ADF Query Panel With Table

Now create the table with suitable attributes.

You will be able to see the page with LOV.
 The value selected in LOV is being passed to the Bind Variable created.




In this way List Of Values with input text can also be created.



 

No comments:

Post a Comment