Sunday, 9 March 2014
LOV in OAF
Notice the way I have added where clause in the voimpl, since there is bug in OAF with bind variables being used in VO query.
Code in Controller
******************************************************
public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
super.processRequest(pageContext, webBean);
OAApplicationModule am =
(OAApplicationModule)pageContext.getApplicationModule(webBean);
String orgId = null;
System.out.println("initializeLOVVO****" + pageContext.getOrgId());
if (pageContext.getOrgId() != 0) {
System.out.println("initializeLOVVO****" + pageContext.getOrgId());
orgId = pageContext.getOrgId() + "";
}
System.out.println(" processFormRequest> SearchEFT Starts *****");
voidEFTLovVOImpl vo =
(voidEFTLovVOImpl)am.findViewObject("voidEFTLovVO1");
Serializable[] parameters = { orgId };
am.invokeMethod("initializeLOVVO", parameters);
System.out.println("initializeLOVVO****" + vo);
}
******************************************************
Call InitQuery in AM
//init orgcontext in VoidLOVVO
public void initializeLOVVO(String orgId)
{
voidEFTLovVOImpl lovvo = getvoidEFTLovVO1();
lovvo.initQuery(orgId);
}
*************************************************
add init query in vimpl
public void initQuery(String orgIdS)
{
OAApplicationModuleImpl localOAApplicationModuleImpl = (OAApplicationModuleImpl)getApplicationModule();
OADBTransactionImpl localOADBTransactionImpl = (OADBTransactionImpl)localOAApplicationModuleImpl.getOADBTransaction();
System.out.println("voidEFTLovVOImpl> initQuery called"+localOADBTransactionImpl.getOrgId()+"");
System.out.println("voidEFTLovVOImpl> initQuery called");
if ((localOADBTransactionImpl.getOrgId()+"" != null) &&
(!("".equals(localOADBTransactionImpl.getOrgId()+""))))
{
System.out.println("voidEFTLovVOImpl initQuery STARTED");
// Do the following conversion for type consistency.
Number orgId = null;
try
{
orgId = new Number(localOADBTransactionImpl.getOrgId()+"");
System.out.println("voidEFTLovVOImpl IN try");
}
catch(Exception e)
{
System.out.println("voidEFTLovVOImpl IN CATCH"+e);
}
setWhereClause(null);
setWhereClauseParams(null);
setWhereClause("ORG_ID ='"+orgId+"'");
executeQuery();
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment