Friday 30 September 2011

Creation of Side Navigation dynamically...to the page

/*===========================================================================+
| Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA |
| All rights reserved. |
+===========================================================================+
| HISTORY |
+===========================================================================*/
package cisco.oracle.apps.pa.revenue.webui;

import oracle.apps.fnd.common.VersionInfo;
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.fnd.framework.webui.beans.layout.OAPageLayoutBean;
import oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.OASideBarHelper;
import oracle.apps.fnd.framework.webui.beans.nav.OASideNavBean;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.nav.OALinkBean;

/**
* Controller for ...
*/
public class SideNavigationCO1 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);
createSideNavigation(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);
}

public void createSideNavigation(OAPageContext pageContext, OAWebBean webBean)
{
OASideNavBean sideNav = (OASideNavBean)createWebBean(pageContext,
OAWebBeanConstants.SIDE_NAV_BEAN,
null, // no need to specify a data type
"sideNav" // always specify name
);
OAStackLayoutBean search =
(OAStackLayoutBean)createWebBean(pageContext,
"/cisco/oracle/apps/pa/revenue/webui/SideSearchRN",
"SideSearchRN", // always specify name
true); // region created in Oracle
sideNav.addIndexedChild(search);
OAPageLayoutBean pageBean = (OAPageLayoutBean)webBean.findIndexedChildRecursive("pageLayoutRN");

pageBean.addIndexedChild(sideNav);

OALinkBean link1 = (OALinkBean)createWebBean(pageContext,
OAWebBeanConstants.LINK_BEAN,
null,
"AllOfferings");
link1.setText("All Offerings");
link1.setDestination("OA.jsp?page=/cisco/oracle/apps/pa/revenue/webui/AllIOfferingPG&retainAM=Y");
sideNav.addIndexedChild(link1);

OALinkBean link2 = (OALinkBean)createWebBean(pageContext,
OAWebBeanConstants.LINK_BEAN,
null,
"MyOfferings");
link1.setText("My Offerings");
link1.setDestination("OA.jsp?page=/cisco/oracle/apps/pa/revenue/webui/MyOfferingPG&retainAM=Y");
sideNav.addIndexedChild(link2);

OALinkBean link3 = (OALinkBean)createWebBean(pageContext,
OAWebBeanConstants.LINK_BEAN,
null,
"Alerts");
link1.setText("My Offerings");
link1.setDestination("OA.jsp?page=/cisco/oracle/apps/pa/revenue/webui/AlertPG&retainAM=Y");
sideNav.addIndexedChild(link3);
search.render(true);
sideNav.render(true);
link1.render(true);
link2.render(true);
link3.render(true);
pageBean.render(true);
}
}

1 comment:

  1. Hi Santosh,

    iam new in OAF, please let me know what is the "AlOffering" in below code
    OALinkBean link1 = (OALinkBean)createWebBean(pageContext,
    OAWebBeanConstants.LINK_BEAN,
    null,
    "AllOfferings");

    kind Regards,
    Shaik

    ReplyDelete