CO:
/*===========================================================================+
| Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA |
| All rights reserved. |
+===========================================================================+
| HISTORY |
+===========================================================================*/
package oracle.apps.ont.mypage.webui;
import java.io.Serializable;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.ont.mypage.server.MyPageAMImpl;
/**
* Controller for ...
*/
public class MyPageCO extends OAControllerImpl
{
public static final String RCS_ID="$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
/**
* Layout and page setup logic for a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
}
/**
* 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);
if (pageContext.getParameter("HelloButton") != null){
OAApplicationModule am=pageContext.getApplicationModule(webBean);
String deptName = pageContext.getParameter("DeptName");
Serializable[] param = new Serializable[]{deptName};
am.invokeMethod("showEmp",param);
}
}
}
AM:
package oracle.apps.ont.mypage.server;
import java.io.Serializable;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
// ---------------------------------------------------------------------
// --- File generated by Oracle ADF Business Components Design Time.
// --- Custom code may be added to this class.
// --- Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class MyPageAMImpl extends OAApplicationModuleImpl {
/**This is the default constructor (do not remove)
*/
public MyPageAMImpl() {
}
/**Container's getter for MyPageVO1
*/
public MyPageVOImpl getMyPageVO1() {
return (MyPageVOImpl)findViewObject("MyPageVO1");
}
/**Sample main for debugging Business Components code using the tester.
*/
public static void main(String[] args) {
launchTester("oracle.apps.ont.mypage.server", /* package name */
"MyPageAMLocal" /* Configuration Name */);
}
public void showEmp(String deptName){
MyPageVOImpl vo=getMyPageVO1();
vo.initQuery(deptName);
}
}
VO:
package oracle.apps.ont.mypage.server;
import java.io.Serializable;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
// ---------------------------------------------------------------------
// --- File generated by Oracle ADF Business Components Design Time.
// --- Custom code may be added to this class.
// --- Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class MyPageVOImpl extends OAViewObjectImpl {
/**This is the default constructor (do not remove)
*/
public MyPageVOImpl() {
}
public void initQuery(){
this.executeQuery();
}
public void initQuery(String deptName){
this.setWhereClauseParams(new String[]{deptName});
this.executeQuery();
}
}