• Skip to primary navigation
  • Skip to main content

Tech Honey

The #1 Website for Oracle PL/SQL, OA Framework and HTML

  • Home
  • HTML
    • Tags in HTML
    • HTML Attributes
  • OA Framework
    • Item in OAF
    • Regions in OAF
    • General OAF Topics
  • Oracle
    • statement
    • function
    • clause
    • plsql
    • sql

executing Vo on submit button click

How to execute a VO on click of a button on an OAF page

October 28, 2012 by techhoneyadmin

Here we will discuss the execution of a VO on click of a submit button.

Now, before starting the discussion I assume that you have created a VO and have the same attached to AM. Also, I assume that you have imported the VOImpl and AMImpl to the controller attached to the page.
One more assumption I would like to make is that the VO name is xxTrialVo, AM name is xxTrialAm and the id of the submit button is xxSubmitButton.

After these assumptions, we are ready to learn how to execute a VO on click of a submit button.

First of all you need to check the click of the submit button. As submit button will post an HTTP request, hence you need to handle the click of the submit button in processFormRequest method. Just see the code below for reference.

if(pageContext.getParameter(“xxSubmitButton”)!=null)
{
pageContext.putSessionValue(“Click”,”Yes”);
pageContext.setForewardURLtoCurrentPage(//pass the required parameters);
}

Now the code above shows that you have caught the event of submit button click.
But our purpose was to execute the VO after submit button click, as we know that once the submit button is clicked the control travels from processFormRequst to processRequest method. Hence, now we will take the advantage of sessionValue that we have put in the code to check whether the control is coming back after submit button click or not. If it is then we will execute the VO.

In order to do this, in the processRequest method, refer to the code below.
if(“Yes”.equals(pageContext.getSessionValue(“Click”))
{
XXTrialVOImpl TrialVO = (XXTrialVOImpl)am.get XXTrialVO1();
TrialVO.executeQuery()
}

Hope you find this informative.
Thanks for reading 🙂

Filed Under: OAF Miscellaneous Tagged With: execute vo in OA Framework, executeVO, executing Vo on submit button click, how to execute a Vo, oa framework vo

Copyright © 2025 · Parallax Pro on Genesis Framework · WordPress · Log in