When we need to write some new business functionalities or validations in the application, we generate the implementation files of the ADF business components and write the code there.
Entity Object Implementation Class:
The Implementation file with highest re-usability is Entity Object Impl.
Objective: When the user enters the department name as ‘Administration Test’, the system should throw error.
Table: Departments,
Bc4j object: DepartmentsEO
Table: Departments,
Bc4j object: DepartmentsEO
Generate the Implementation class file for the EO as below.
Open the Impl class file and find the getter/setter methods of the attributes.
In our case, let’s look for the setter method of the DepartmentName attribute.
In our case, let’s look for the setter method of the DepartmentName attribute.
Now, let’s make the ‘AutoSubmit’ property of the DepartmentName item to ‘true’ as below.
Let’s enter the DepartmentName as ‘Administration Test’. The system will give us the error message when we tab out.
View Object Implementation Class:
Objective: To filter the Departments for a Department as default.
Bc4j object: DepartmentsVO
Generate the Implementation class file for the VO as below.
Bc4j object: DepartmentsVO
Generate the Implementation class file for the VO as below.
We will override an existing method in the VOImpl as below.
Will write the following code for the method.
Let’s run and test the page, the department with departmentNo as 10 will be displayed.
Application Module Implementation Class:
Objective: To create a Department record.
Bc4j object: AM
Generate the Implementation class file for the AM as below.
Bc4j object: AM
Generate the Implementation class file for the AM as below.
Write a new method in the AMImpl as below.
Expose the above method to client interface.
The new method would appear in the Data Controls for this AM Data control.
Let’s drag this method from Data Control to the JSP page as a button.
Time to run and test the page!
Let’s drag this method from Data Control to the JSP page as a button.
Time to run and test the page!
ليست هناك تعليقات:
إرسال تعليق