While loading the page, processRequest() won't called

757 Views Asked by At

I am new in OAF. I am writing a small program for displaying data in the browser window. But as per the OAF Documentation, when a page loads processRequest() should be called automatically. But in my case the processRequest() method is not called. So any one please help me to get the processRequest() method to be called when page is loaded.

This is my Controller code. Note I associate this controller to a page. While loading the page, processRequest() method is not called.

public class MyController extends OAControllerImpl
{
  public static final String RCS_ID = "$Header$";
  public static final boolean RCS_ID_RECORDED = 
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

  /**
   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
   /* The below code line is used to initialize the application module */
    System.out.println("inside processRequest");
    OAApplicationModule am = 
      (OAApplicationModule)pageContext.getApplicationModule(webBean);
     // am.invokeMethod("execVO");
    /* The below code line is used to initialize VO*/
   OAViewObject vo = (OAViewObject)am.findViewObject("EmpView1");
    /* DataDisplayVO1 is the instance name in AM which is the original name of the VO */
    vo.executeQuery();
    RowSetIterator rowsetIterator = vo.createRowSetIterator(null);
    while (rowsetIterator.hasNext())
    {
      Row r = rowsetIterator.next();
      System.out.println("Empno is ... " + r.getAttribute("Empno"));
    }

  }
1

There are 1 best solutions below

0
On

This is impossible. In my experience, till now I have never faced any issues like this.

On a second thought, just thinking if the controller is not assigned to the page. It may happen although in rarest case. And the case is you have run the page before attaching the controller and the page xml is stored in your classes directory. This directory is refreshed on each run, but rarely it doesn't get refreshed.

Try to rebuild your application, if possible delete the classes folder content of your relevant package. Hopefully it may help.