Introduction
OAF developers often come across requirements where they are required to render entire OAF page read-only and don’t want to edit any of the fields in the page. For example, a quote can be editable till it is submitted to Order Management (OM). But once the quote is submitted to OM, entire page should be rendered as Read-Only. But there is no built-in property for OAF pages and regions where we can set the read-only property true for the entire page.
There is utility class available in R12 instance for setting the entire page read-only.
Converting Page to read-only in R12 Instance:
The following are the steps for making Page Read-Only using utility class provided in R12.
1. Modify the OA controller class attached to the page and import the seeded class oracle.apps.po.common.webui.ClientUtil
2. Call the function ClientUtil.setViewOnlyRecursive(oapagecontext, oawebbean) when the required condition is satisfied for rendering the page read-only (i.e. we want to render the page read-only if session Value for PAGE_OPEN_MODE session variable is ‘Read only’), at the end of process request method.
The above steps would convert all types of items in the page as read-only (including the table details region)
Implementation
The read only conversion of the OAF page components can be implemented as below:
Custom Page
If the page is a custom page the method ClientUtil.setViewOnlyRecursive(oapagecontext, oawebbean) can be directly invoked from the processRequest method of the page’s controller.
Standard PageIf the page is a standard page, below steps are required:
· Create a custom controller by extending with the standard page’s controller.
· Upload the custom controller file to the server, provide the necessary permissions to the file
· Modify the page’s controller with reference to the custom controller through customizations.
· Invoke the function ClientUtil.setViewOnlyRecursive(oapagecontext, oawebbean) from the processRequest method of the custom controller.