Wednesday, 11 July 2018

pagecontext.getparameter(event_param) in oaf


pagecontext.getparameter(event_param) in oaf

pagecontext.getparameter(Event_Param) helps to capture the event generated by a webbean in the oaf Page. Web bean could be messageinputtext or messageStyleText, or messageLovInput or table in the oaf page. With the help of EVENT_PARAM we can identify the generated event in the OAF and then write the code according to that as per the Webbean event generated.
 
Now our coding Part will be start. So First we will create method under the RohitPartialRendringAMIMPL.java class.

Here is the Code.
 
 
public void handlePPRAction() 
  {
    Number val1=1;
    OAViewObject vo=(OAViewObject)findViewObject("RohitPartialRendringVO");
    
     if(vo!=null)
     {
      
       if (vo.getFetchedRowCount()==0)
       {
         vo.setMaxFetchSize(0);
         vo.executeQuery();
         vo.insertRow(vo.createRow());
        
        OARow row=(OARow)vo.first();
        row.setAttribute("RowKey", val1);
        row.setAttribute("DummyAttr",Boolean.TRUE);
         row.setAttribute("DummyAttr2",Boolean.TRUE);
       
       
       }
      
     }
  }
 
Double click on the Controler name "RohitPartialRendringCO".

Put the code under the Process Form Request Block.


 public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
   
    OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(webBean);
    am.invokeMethod("handlePPRAction");
   
  }

  /**
   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(webBean);
   
    OAViewObject vo=(OAViewObject)am.findViewObject("RohitPartialRendringVO");
   
    OARow row=(OARow)vo.getCurrentRow();
   
    if ("action1".equals(pageContext.getParameter(EVENT_PARAM)))
    {
     
      row.setAttribute("DummyAttr",Boolean.TRUE);
       row.setAttribute("DummyAttr2",Boolean.FALSE);
    }
   
   

    if ("action2".equals(pageContext.getParameter(EVENT_PARAM)))
    {
     
      row.setAttribute("DummyAttr",Boolean.FALSE);
       row.setAttribute("DummyAttr2",Boolean.TRUE);
    }

   
   
  }

0 comments:

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *