Search

Friday, May 21, 2010

Dynamic OA Personalization using FormFunctions

Requirement: Hiding a field in an OA page based on the responsibility from which the page was opened. For example, consider hiding the ‘Start Action’ column in Payment Process Requests Tab (Navigation: AP Super User > Payments > Payments Manager > Payment Process Requests Tab)

image

 

Option-1:

  • At the responsibility level, set the rendered property to false.
  • Drawback:
    • We need to hide the column for multiple responsibilities. Hence, we need to open the same OA page in different responsibilities and then, hide the column using OA personalization

 

Option-2: Very apt if all the responsibilities where the column is to be hidden use the same menu. This tutorial is about option-2

  1. Create a new Form Function of UnknownType’
  2. Find the name of the menu being used for accessing the OA page
  3. Query for the menu and add the new form function created above in Step-1 and select the ‘Grant’ checkbox
  4. Go to the OA page that needs to be personalized and select the column that needs to be shown/hidden for personalization. In the rendered property at the site level enter the SPEL expression as ‘${oa.FunctionSecurity.<functionName>}’
  5. This means if the menu has the above created function with ‘Grant’ checkbox checked, then the column gets displayed; otherwise the column remains hidden

Detailed Steps to follow:

  • Create a new Form Function

image

 

image

 

  • Query for the responsibility and then copy the name of menu that is being used

image

  • Query for the Menu AP_NAVIGATE_GUI12 and add the form-function created in the first steps. The Grant checkbox will decide whether the column on the OA page will be displayed or not. If the Grant checkbox is selected, then the column will be displayed. If the Grant checkbox is not selected, then the column will be hidden.

image

  • Now go to the OA page (Navigation: AP Super User > Payments > Payments Manager > Payment Process Requests Tab)
image
 
  • Click on “Personalize Page”

image

  • Click on the Update icon (Pencil Icon) for the item Column: (ActionSwitcherCol)” to view the below page. Now for the Rendered property, at the site level, select ‘SPEL’ from the poplist and then in the textbox next to it, enter ‘${oa.FunctionSecurity.XX_CARE_TEST}’ and click on ‘Apply’

image

  • Now, go back to the Menu form and query for the Menu. De-select the Grant checkbox and save to hide the Start Action column

image

  • We observe that the Start Action column is hidden
image
 
***** End of Exercise! :) *****

No comments: