Switcher region in oaf
In this post , We will Discuss about Switcher region in oaf and how we can use in the OAF Page.Switcher regions is used to dynamically switch display items in the OAF page. With the help of Switcher region in oaf we can switch between multiple display items and only one item will be display between all the switch display items based on the conditions which will be true for specific item. This is more like Case statement , which executes only one between multiple conditions or cases. Here below I will show the complete steps of how we can use the Switcher region in oaf with working Example
Working Example of Switcher region in oaf
We have Requirment , We have Supplier Delete page in OAF , but we want to enable the Delete icon only for that suppliers which have no AP invoices Open. So I have creates Procedure XXSUPPLIER_INVOICE in which we pass Supplier No which returns 'YES' if that supplier does not have open invoices for payments but returns 'NO' if that supplier have open invoices for Payments.
Step1:- This is the Supplier Deletion Page , in this We have Delete Record Icon , Which will be Enabled and Disable based on the Conditions above.
Step2:-First I need to find the VO object which is working for this Page, Here below is the VO and now I am adding the new Column which XXSUPPLIER_INVOICE in which we pass Supplier No which returns 'YES' if that supplier does not have open invoices for payments but returns 'NO' if that supplier have open invoices for Payments.
select SupplierNo,SupplierName,SupplierAlias,SupplierCreation_date,
Address1,Age,
DECODE(XXSUPPLIER_INVOICE(SupplierNo),'YES','DeleteEnable','DeleteDisable') as DeleteButton
from Ap_suppliers
where sysdate between start_date and nvl(end_date, sysdate)
Step3:- Here below is the Table which is using in the Above OAF Page.
Step4:-Now Right Click on the Table ==> Click New and Click Bew Column.
Step5:- Now my New Column has been Created. Now Right Click on the New Column and Create Switcher as below.
Step6:-As Below Region3 is my Switcher region created in the Last step
Step7:- Now go to the Properties of the Switcher Region3 and Select the Column name which is created in the Step2 under the Existing VO. 'DeleteButton' is the VO Attribute.
Step8:- You will notice a <case> item being created under the Switcher Region.
Now we have two conditions in which we want to Display the Delete Icon Enabled and Disabled. so We need to create another case 2.To Create New Case Right Click on the Switcher region , new and then Click Case.
Step9:- Now Right Click on the First case and Create New Item as below.
Step10:-
For the Second Item, Set the following Properties
ID: DeleteEnabled
Item Style: image
Prompt: Delete
Image URL: deleteicon_enabled.gif
Rendered: True
Item Style: image
Prompt: Delete
Image URL: deleteicon_enabled.gif
Rendered: True
Make sure you are giving the ID of the Item exactly matching with the View Attribute value being returned by the "DeleteButton" in the Sql Query of VO
Step11:- Same Like Above step , create new Item under the Second Case.
Set the following properties to the First Case Item.
ID: DeleteDisable
Item Style: image
Prompt: Delete
Image URL: deleteicon_disabled.gif
Rendered: True
ID: DeleteDisable
Item Style: image
Prompt: Delete
Image URL: deleteicon_disabled.gif
Rendered: True
Step12:- Delete Switched region in oaf is created as below.
1 comments:
This is just the kind of information that I had been looking for a long time. Thank you very much for posting this blog its very nice. Please contact us for Oracle R12 Financials Training in Hyderabad details in our Erptree Training Institute
Post a Comment