首页 > 代码库 > OAF_OAF控件Tree的实现(案列)
OAF_OAF控件Tree的实现(案列)
2014-06-02 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节点的初始化
1 public void processRequest(OAPageContext pageContext, OAWebBean webBean){ 2 3 super.processRequest(pageContext, webBean); 4 5 OAApplicationModule am = pageContext.getApplicationModule(webBean); 6 7 am.invokeMethod("initTreeQuery"); 8 9 }
5. 设定TreeDetailCO,进行Detail页面的初始化
1 public void processRequest(OAPageContext pageContext, OAWebBean webBean){ 2 3 super.processRequest(pageContext, webBean); 4 5 OAPageLayoutBean pageLayout = pageContext.getPageLayoutBean(); 6 7 pageLayout.prepareForRendering(pageContext); 8 9 UINode tabBar = pageLayout.getTabs(); 10 11 int childCount = 0; 12 13 if( tabBar != null ) { 14 15 childCount = tabBar.getIndexedChildCount(pageContext.getRenderingContext()); 16 17 } 18 19 for( int i=0; i<childCount; i++){ 20 21 LinkBean child = (LinkBean) tabBar.getIndexedChild(pageContext.getRenderingContext(), i); 22 23 if( child != null ) { 24 25 child.setTargetFrame("_top"); 26 27 } 28 29 } 30 31 OAApplicationModule am = pageContext.getApplicationModule(webBean); 32 33 String employeeId = pageContext.getParameter("employeeId"); 34 35 Serializable[] parameters = { employeeId }; 36 37 am.invokeMethod("initDetails", parameters); 38 39 }
四、案例测试
Thanks and Regards