Total Pageviews

Tuesday 31 October 2017

Useful Codes Used in OAF -2

Method To Insert the record in the table.

write the following code in the AM

public void InsertRecord()
{
  InsertVOImpl vo= getInsertVO1();
  OADBTransaction trans= getOADBTransaction();
  vo.executeQuery();
  Row v_row;
  v_row = (Row)vo.createRow();
  vo.insertRow(v_row);
}


The following code shows the initialization process of AM in controller.

public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
    super.processRequest(pageContext, webBean);
    InsertRecordsAMImpl am=(InsertRecordsAMImpl)pageContext.getApplicationModule(webBean);
    am.InsertRecord();

}


The following code shows the creation of record.

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
  super.processFormRequest(pageContext, webBean);
   InsertRecordsAMImpl am=(InsertRecordsAMImpl)pageContext.getApplicationModule(webBean);
    if(pageContext.getParameter("item6")!=null)
    {
     am.getOADBTransaction().commit();
     throw new OAException("Data Created sucsessfully",OAException.CONFIRMATION);
    }
}

No comments:

Post a Comment