Let us learn how to create Exception messages in OAF. This lesson will take us to show that how to create Exception messages, alert messages, warning messages in OAF pages.
One Item to enter text so take it as “Message Text Input” and another item is “Submit Button”. Hence we already seen in previous chapters how to create Message Text Input item and Submit Button.
Now run the page and just see the output how it looks, the below figure shows the sample output and if we observe there is no gap between Submit Buttons and Message Text Input Item.
Now to create a space between buttons and items we have one item called “spacer”. Create two items under Message Layout and select Item Style as a spacer and in Property Inspector give width as 10.
Click on the spacer item hold it and drag it between the Submit Button items, in Message component Layout region directly we cannot create spacer item, so, therefore, create one message layout hold that item and place between Message Text Input item and Message Layout Item which is created early.
Now under the second message Layout item create one item with Item Style as “spacer” and give height as 10 in Property Inspector.
After creation the page structure looks like the following:
Create the controller under the main region and write the code logic in “process Form Request”.
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("item3")!=null)
{
String name=pageContext.getParameter("item6");
throw new OAException(name,OAException.ERROR);
}
if(pageContext.getParameter("item4")!=null)
{
String name=pageContext.getParameter("item6");
throw new OAException(name,OAException.CONFIRMATION);
}
if(pageContext.getParameter("item5")!=null)
{
String name=pageContext.getParameter("item6");
throw new OAException(name,OAException.WARNING);
}
}
In the above code item3, item4, item5 are the id values of the Submit Button items with prompt Exception, Confirm, Warning. Item6 is the id value of Message Text Input item.
The import package is :
import oracle.apps.fnd.framework.OAException;
Run the page and see the output. Give some text in Message Input Text and then click on the button to see the messages displayed on OAF. For example, see the following:
Check out our Popular Trainings Structure of OAF Advantages and Dis-Advantages of OAF Oracle OSB Training in Chicago Creating First OAF Page in Project
You liked the article?
Like : 0
Vote for difficulty
Current difficulty (Avg): Medium
1/15
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.
Stay Updated
Get stories of change makers and innovators from the startup ecosystem in your inbox