الثلاثاء، 7 أبريل 2020

Oracle ADF Managed Beans Programming

Programming through Managed Beans:

Objective: Show error when user wants to view employees of a manager (with manager id 201)
Let’s create a page with two tabs (using PanelTabbed Layout) as below. Let’s use the Master-Detail functionality to show the Managers on Tab-1 and Employees on Tab-2.
1
On View Employees button on the Managers tab, let’s update the action listen.
2
Let’s create a managed bean(if doesn’t exist already) and a method for the above button.
3
4

Now, open the managed bean class and edit the method(NavigateToEmps) as below:
public Object NavigateToEmps() {
      Object managerId = MyADFUtil.getAttributeFromIterator(“DepartmentsView1Iterator”, “ManagerId”);      if (managerId.equals(201)) {                MyADFUtil.showErrorMessage(“Employee Details are classified for this           manager”);return null;}MyADFUtil.putInSessionScope(“DepartmentId”, MyADFUtil.getAttributeFromIterator(“DepartmentsView1Iterator”, “DepartmentId”));return “Emps”;}
5
It’s time to run the page and see the error message for the manager with id 201.

ليست هناك تعليقات:

إرسال تعليق

ADF: Programmatic View Object Using Ref Cursor.

ADF: Programmatic View Object Using Ref Cursor. Posted by:  Manish Pandey   April 25, 2013   in  ADF   Leave a comment   3758 Views Sometime...