Validation is the basic and the most important aspect of software development. If you are a software developer, working in any language or domain, then validating the data entered should not be a new thing to you, even there arises multiple situations while working with oracle apps where you need to put validations on the OA Framework page. So let’s see how this is done as far as OA Framework is concerned.
Suppose you have an OAF page and on that page you have a text box (OAMessageTextInputBean) and a button (OASubmitButtonBean). Now suppose that on the click of the button you want to add some validation logic, in order to achieve this we need to capture the click of the button event and within that event we can add the required business logic.
To capture the click of the submit button we need to follow the following steps.
Step 1: import the OASubmitButtonBean to the controller
import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
Step 2: capture the submit button click event in the processFormRequest() method of the controller
if(pageContext.getParameter(“xxTrialSubmitButton”)!=null)
{
}
Step3: Add the require validation logic within the captured event
if(pageContext.getParameter(“xxTrialSubmitButton”)!=null)
{
The validation logic goes here…
}
Make sure that you throw appropriate exceptions whereever mentioned as per the Functional and Technical Documents.
Thanks and Keep Learning