In my previous blogspot I showed you the new JDeveloper 11gR2 EJB and ADF DataControl features and in this blogpost I will use this EJB or Java DataControl in a JSF page.
I made a simple EJB model project which uses the dept and emp tables of the Scott schema. This project also contains with a Session Bean on which I generated an ADF DataControl.
When you open the DataControls.dcx in your model project and select one of your DataControl entries you can click on the edit button. This will open and generate an ADF entity xml in which you can change some properties.
We will add a new Named Criteria in which you can search on a particular location of the department. This criteria can be used in a Query Panel.
The criteria dialog, where I add the location attribute of the dept entity and compare it with a bind variable.
When we switch to the ViewController project, you will see this criteria in the DataControl Window.
You can run this page and in the top right Combobox you can select your criteria, next the bind variable will be shown on the query panel.
The second part of this blogpost will show you, how you can change a department of a employee. Here you can see that the employee entity has the department entity as attribute( no dept_id attribute).
You can see that there is no combobox option for the department entity but you can include its attributes.
The Base Data Source is the dept entity inside the Employee entity and add a new other department operation as List Data Source
Add the data mapping and display some department attributes.
This time a combobox is displayed and you can change the department on the employee