How to embed custom HTML code in OAF Page

It’s always that all the text on an OA Framework page is in black color. Ever thought of having a text in other color e.g. a note just after a table in a smaller font and in red color?

Here we will have a look at how to embed a custom HTML code in OA framework page and have a different color to that HTML text so that the text looks different from the rest of the text on the OA Framework page.
In order to do this, we need to use the OARawTextBean as it’s the only OAF item bean which supports the use of HTML tags.

Before discussing further I assume that you have an OA framework page e.g. xxTrialPG and also a controller to that page like xxTrailController.
Also I assume that you have created an OARawTextBean under the pagelayout region and the id of the OARawTextBean is xxTrialRawTextBean.

notePlease note that all the lines that come in italics are the java code lines, this is done for easy segregating code from text in the post.

Again, let’s take this in steps for easy understanding and remembrance.

Step1: – Import the OARawTextBean in the controller so we will be able to create handles for it. Import the OARawTextBean bean as shown below.

import oracle.apps.fnd.framework.webui.beans.OARawTextBean;

Step2: – In the processrequest method create a handle for the OARawTextBean and create a String to write the HTML code in it.

OARawTextBean trialRawTextBean = (OARawTextBean)webBean.findChildRecursive(“xxTrialRawTextBean “);

code to embed custom HTML code in OA Framework Page

Step 3: – Set the String variable as the text to the OARawTextBean as shown below and run the page.

trialRawTextBean.setText(theHTMLCode);

Step 4: – You should be able to see the Text that you have written as shown below in your OAF Page.

How to embed custom HTML code in OA Framework Page

Leave a Reply

Your email address will not be published. Required fields are marked *