Sunday, September 13, 2009

Create a run time VO in OA framework

To create a run time VO you have to follow these steps which are given below:

OAApplicationModule am = pageContext.getApplicationModule(webBean);

OADBTransaction oadbtransaction = am.getOADBTransaction();
String validateStr1 = "select column_name from table_name where column_name = :1";

ViewObject validateViewObject1 = (ViewObject)am.findViewObject("ValidateCodeVO1");

if (validateViewObject1 == null)
validateViewObject1 = (ViewObject)am.createViewObjectFromQueryStmt("ValidateCodeVO1", validateStr1);

validateViewObject1 = (ViewObject)am.findViewObject("ValidateCodeVO1");

if (validateViewObject1 != null)
{
validateViewObject1.setWhereClause(null);
validateViewObject1.setWhereClauseParam(0, pageContext.getParameter("NtfId"));
validateViewObject1.executeQuery();
validateViewObject1.reset();

oracle.jbo.Row validaterow = validateViewObject1.first();

if (validaterow != null)
message_type = validaterow.getAttribute(0).toString();
}

2 comments:

Anonymous said...

Thanks ! Works cool.

Arun

Anonymous said...

thanks mate ! i used your suggestion ! -- krakx !:-)