2014-06-02 Created By BaoXinjian


实现OAF的Tree功能


需求:实现OAF的Tree功能

1. 建立两个Page,树结构页面和明细页面

2. 在树页面中建立Tree,在Tree中建立Node和 Members

(1). Node的重要属性

URI:OA.jsp?page=/bxj/oracle/apps/ak/test/webui/TreeDetailPG&employeeId={@EmployeeId}&OAPLRS=PLNH

Target Frame: OACFr

(2). Members的重要属性

URI:/bxj/oracle/apps/ak/test/webui/TreeRootPG.TreeRN

View Link Instance: ???

View Link Accessor: DirectReport、

(3). &OAPLRS=PLNH: 代表了打开的Page无Window Title结构

3. 建立三个Function

(1). Function1:设定为Tree Page

OA.jsp?page=/bxj/oracle/apps/ak/test/webui/TreeRootPG&OAPLRS=PLNH

(2). Function2: 设定为Detail Page

OA.jsp?page=/bxj/oracle/apps/ak/test/webui/TreeDetailPG

(3). Function3: 设定为虚拟,对应Tree&Detail Page

OAFrame.jsp?OAFunc=FWK_TBX_TREE_CENTERFRAME:FWK_TBX_TREE_STARTFRAME:FWK_TBX_TREE_CENTERFRAME

&OAHP=FWK_TOOLBOX_TUTORIAL_APP

&OASF=FWK_TOOLBOX_SAMPLE_BROWSE

&OAFRDIM=30p:15p

4. 设定两个CO对应至Page,及代码

5. 进行测试


1. 设定Root Tree的Node属性

2. 设定Root Tree的Members属性

3. 建立Functions

4. 设定TreeRootCO,进行Tree节点的初始化

 public void processRequest(OAPageContext pageContext, OAWebBean webBean){

     super.processRequest(pageContext, webBean);

     OAApplicationModule am = pageContext.getApplicationModule(webBean);

     am.invokeMethod("initTreeQuery");

 }

5. 设定TreeDetailCO,进行Detail页面的初始化

 public void processRequest(OAPageContext pageContext, OAWebBean webBean){

     super.processRequest(pageContext, webBean);

     OAPageLayoutBean pageLayout = pageContext.getPageLayoutBean();

     pageLayout.prepareForRendering(pageContext);

     UINode tabBar = pageLayout.getTabs();

     int childCount = 0;

     if( tabBar != null ) {

         childCount = tabBar.getIndexedChildCount(pageContext.getRenderingContext());

     }

     for( int i=0; i<childCount; i++){

         LinkBean child = (LinkBean) tabBar.getIndexedChild(pageContext.getRenderingContext(), i);

         if( child != null ) {

             child.setTargetFrame("_top");

         }

     }

     OAApplicationModule am = pageContext.getApplicationModule(webBean);

     String employeeId = pageContext.getParameter("employeeId");

     Serializable[] parameters = { employeeId };

     am.invokeMethod("initDetails", parameters);

 }

Thanks and Regards

05-11 21:59