Create Auto Customization Criteria OAF Search Page
- by PRajkumar
1. Create a New Workspace and Project
Right click Workspaces and click create new OAworkspace and name it as PRajkumarCustSearch. Automatically a new OA Project will also be created. Name the project as CustSearchDemo and package as prajkumar.oracle.apps.fnd.custsearchdemo
2. Create a New Application Module (AM)
Right Click on CustSearchDemo > New > ADF Business Components > Application Module
Name -- CustSearchAM
Package -- prajkumar.oracle.apps.fnd.custsearchdemo.server
3. Enable Passivation for the Root UI Application Module (AM)
Right Click on CustSearchAM > Edit SearchAM > Custom Properties >
Name – RETENTION_LEVEL
Value – MANAGE_STATE
Click add > Apply > OK
4. Create Test Table and insert data some data in it (For Testing Purpose)
CREATE TABLE xx_custsearch_demo
( -- ---------------------
-- Data Columns
-- ---------------------
column1 VARCHAR2(100),
column2 VARCHAR2(100),
column3 VARCHAR2(100),
column4 VARCHAR2(100),
-- ---------------------
-- Who Columns
-- ---------------------
last_update_date DATE NOT NULL,
last_updated_by NUMBER NOT NULL,
creation_date DATE NOT NULL,
created_by NUMBER NOT NULL,
last_update_login NUMBER
);
INSERT INTO xx_custsearch_demo VALUES('v1','v2','v3','v4',SYSDATE,0,SYSDATE,0,0);
INSERT INTO xx_custsearch_demo VALUES('v1','v3','v4','v5',SYSDATE,0,SYSDATE,0,0);
INSERT INTO xx_custsearch_demo VALUES('v2','v3','v4','v5',SYSDATE,0,SYSDATE,0,0);
INSERT INTO xx_custsearch_demo VALUES('v3','v4','v5','v6',SYSDATE,0,SYSDATE,0,0);
Now we have 4 records in our custom table
5. Create a New Entity Object (EO)
Right click on SearchDemo > New > ADF Business Components > Entity Object
Name – CustSearchEO
Package -- prajkumar.oracle.apps.fnd.custsearchdemo.schema.server
Database Objects -- XX_CUSTSEARCH_DEMO
Note – By default ROWID will be the primary key if we will not make any column to be primary key
Check the Accessors, Create Method, Validation Method and Remove Method
6. Create a New View Object (VO)
Right click on CustSearchDemo > New > ADF Business Components > View Object
Name -- CustSearchVO
Package -- prajkumar.oracle.apps.fnd.custsearchdemo.server
In Step2 in Entity Page select CustSearchEO and shuttle them to selected list
In Step3 in Attributes Window select columns Column1, Column2, Column3, Column4, and shuttle them to selected list
In Java page deselect Generate Java file for View Object Class: CustSearchVOImpl and Select Generate Java File for View Row Class: CustSearchVORowImpl
7. Add Your View Object to Root UI Application Module
Select Right click on CustSearchAM > Application Modules > Data Model
Select CustSearchVO and shuttle to Data Model list
8. Create a New Page
Right click on CustSearchDemo > New > Web Tier > OA Components > Page
Name -- CustSearchPG
Package -- prajkumar.oracle.apps.fnd.custsearchdemo.webui
9. Select the CustSearchPG and go to the strcuture pane where a default region has been created
10. Select region1 and set the following properties:
ID -- PageLayoutRN
Region Style -- PageLayout
AM Definition -- prajkumar.oracle.apps.fnd.custsearchdemo.server.CustSearchAM
Window Title – AutoCustomize Search Page Window
Title – AutoCustomization Search Page
Auto Footer -- True
11. Add a Query Bean to Your Page
Right click on PageLayoutRN > New > Region
Select new region region1 and set following properties
ID – QueryRN
Region Style – query
Construction Mode – autoCustomizationCriteria
Include Simple Panel – False
Include Views Panel – False
Include Advanced Panel – False
12. Create a New Region of style table
Right Click on QueryRN > New > Region Using Wizard
Application Module – prajkumar.oracle.apps.fnd.custsearchdemo.server.CustSearchAM
Available View Usages – CustSearchVO1
In Step2 in Region Properties set following properties
Region ID – CustSearchTable
Region Style – Table
In Step3 in View Attributes shuttle all the items (Column1, Column2, Column3, Column4) available in “Available View Attributes” to Selected View Attributes:
In Step4 in Region Items page set style to “messageStyledText” for all items
13. Select CustSearchTable in Structure Panel and set property Width to 100%
14. Include Simple Search Panel
Right Click on QueryRN > New > simpleSearchPanel
Automatically region2 (header Region) and region1 (MessageComponentLayout Region) created
Set Following Properties for region2
Id – SimpleSearchHeader
Text -- Simple Search
15. Now right click on message Component Layout Region (SimpleSearchMappings) and create two message text input beans and set the below properties to each
Message TextInputBean1
Id – SearchColumn1
Search Allowed – True
Data Type – VARCHAR2
Maximum Length –
CSS Class – OraFieldText
Prompt – Column1
Message TextInputBean2
Id – SearchColumn2
Search Allowed -- True
Data Type – VARCHAR2
Maximum Length – 100
CSS Class – OraFieldText
Prompt – Column2
16. Now Right Click on query Components and create simple Search Mappings. Then automatically SimpleSearchMappings and QueryCriteriaMap1 created
17. Now select the QueryCriteriaMap1 and set the below properties
Id – SearchColumn1Map
Search Item – SearchColumn1
Result Item – Column1
18. Now again right click on simpleSearchMappings -> New -> queryCriteriaMap, and then set the below properties
Id – SearchColumn2Map
Search Item – SearchColumn2
Result Item – Column2
19. Congratulation you have successfully finished Auto Customization Search page. Run Your CustSearchPG page and Test Your Work