Requirement: Let us assume we have two Regions in our page. The first is for the Search Panel, and the second region is to display the Search Results in a tabular format.
In the Search Panel we will have an item to enter the Department ID, and also a Search button.
In the Search Results region, we will be displaying the Employees Data corresponding to the Department ID which we entered in the Search Panel.
Sample screen is shown below:
Solution: For solution of the above requirement follow the steps as shown below:
Step 1: Let us create a Blank Page > Create two Regions with the name as Search Panel, and Search Results.
Step 2: Inside the Search Panel region let me have a Text Item and a Button as shown below:
Step 3: Set the property of the Search Results regions as below
- Title: Search Result
- Type: Interactive Grid
- Location: Location Database
- Type: Table/View
- Table Name: EMPLOYEES
- Where Clause: DEPARTMENT_ID = nvl(:P2_DEPARTMENT_ID, DEPARTMENT_ID)
- Page Items to Submit: P2_DEPARTMENT_ID
Step 4: Create a Dynamic Action for the P2_SEARCH_BUTTON. Set the below properties for the Dynamic Action
- Name: Reset_Report
- Event: Click
- Selection Type: Button
- Button: P2_SEARCH_BUTTON
Step 5: Set the properties of the True outcome as below:
- Action: Refresh
- Selection Type: Region
- Region: Search Result
- Event: Refresh_Report
Save the changes and run the application. Thus, the ran application is shown below:
Give the value for the Department Id field as 3, and click on the Search button. And with that we can see the Search Results is getting refresh and displaying only those Employees whose Department Id is 3.
Hence, the solution to our requirement.
Thanks & Regards,
548 total views, 2 views today