Code in Controller(co):
==============
public void processRequest(OAPageContext pageContext, OAWebBean webBean)Code in the Application Module(AM):
{
super.processRequest(pageContext, webBean);
OAApplicationModule am=pageContext.getApplicationModule(webBean);
am.invokeMethod("xxInitPPRRow");
am.invokeMethod("xxHideFields");;
}
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModule am=pageContext.getApplicationModule(webBean);
if("XX_HANDLE_UOM_EVENT".equalsIgnoreCase(pageContext.getParameter(EVENT_PARAM)))
{
am.invokeMethod("xxHandlePPR");
}
}
=======================
public void xxInitPPRRow()Query in VO#1:PPRDemoVO:
{
PPRDemoVOImpl vo=getPPRDemoVO1();
Row row = vo.createRow();
if(!vo.isPreparedForExecution())
{
vo.setMaxFetchSize(0);
}
vo.insertRow(row);
row.setAttribute("Nou","Sample No of Units");
row.setAttribute("Wob","Sample Box");
row.setAttribute("Vol","Sample Volume");
row.setNewRowState(Row.STATUS_INITIALIZED);
}//End of InitPPRRRow Method..
public void xxHandlePPR()
{
PPRDemoVOImpl vo=getPPRDemoVO1();
PPRDemoVORowImpl row=(PPRDemoVORowImpl)vo.getCurrentRow();
if(row.getUom()!=null && !"".equals(row.getUom()))
{
String uomValue =row.getUom();
if(uomValue.equals("EA")) //Handle for Number of Units(NOU)
{
row.setA1(true);
row.setA2(false);
row.setA3(false);
row.setA4("yes");
}
else if(uomValue.equals("BOX")) //Handle for weight of Box(WOB)
{
row.setA1(false);
row.setA2(true);
row.setA3(false);
}
else //Handle for volume of gallon (VOG)
{
row.setA1(false);
row.setA2(false);
row.setA3(true);
}
}
else
{
this.xxHideFields();
throw new OAException("Select atlease one Value",OAException.ERROR);
}
} //End of xxHadlePPR Method
public void xxHideFields()
{
PPRDemoVOImpl vo=getPPRDemoVO1();
PPRDemoVORowImpl row=(PPRDemoVORowImpl)vo.getCurrentRow();
row.setA1(false);
row.setA2(false);
row.setA3(false);
}//End of xxHideFields method
===================
SELECT PPRDetailsEO.UOM,
PPRDetailsEO.NOU,
PPRDetailsEO.WOB,
PPRDetailsEO.VOL,
PPRDetailsEO.CREATED_BY,
PPRDetailsEO.CREATION_DATE,
PPRDetailsEO.LAST_UPDATED_BY,
PPRDetailsEO.LAST_UPDATE_DATE,
PPRDetailsEO.LAST_UPDATE_LOGIN,
PPRDetailsEO.ROWID
FROM XX_TEST_PPR PPRDetailsEO
Query in VO#2(Poplist VO):
==================
select LOOKUP_CODE,MEANING from fwk_tbx_lookup_codes_vl where lookup_type = 'FWK_TBX_UNIT_OF_MEASURE'
0 comments:
Post a Comment