zoukankan      html  css  js  c++  java
  • How to create VO s and VLs dynamically in OAF

    I have to create 2 VO objects dynamicaly and created 2 VL's dynamically .I have a static HGrid.and iam setting viewlinks dynamically.It is working for 1 level but not another leve..For Example.. Grid id displaying projects to Tasks but not tasks to subtasks.

    here is my code

    public void createViewLink(){
    OADBTransaction dbTransaction=getOADBTransaction();
    OAViewObject obj = (OAViewObject)this.findViewObject("TestProjects1VO1"); 
    OAViewObject obj1 = (OAViewObject)this.findViewObject("TestTasks1VO1"); 

    AttributeDef] prjLinkAttrs = new AttributeDef[ { obj.findAttributeDef("ProjectId") };
    AttributeDef] taskLinkAttrs = new AttributeDef[ { obj1.findAttributeDef("ProjectId") };
    ViewLink vl = createViewLinkBetweenViewObjects("TestPrjToTestTasksVL","TestPrjToTasksAcc",
    obj,prjLinkAttrs,obj1,taskLinkAttrs,null);



    //OAViewObject obj3 = (OAViewObject)this.findViewObject("TestTasks1VO1"); 
    OAViewObject obj2 = (OAViewObject)this.findViewObject("TestRecTasks1VO1"); 


    AttributeDef] taskAttrs = new AttributeDef[ { obj1.findAttributeDef("TaskId") };
    AttributeDef] parentTaskAttrs = new AttributeDef[ { obj2.findAttributeDef("ParentTaskId") }; 



    ViewLink vl1 = createViewLinkBetweenViewObjects("TaskToTestTasksVL","TaskToTasksAcc",
    obj1,taskAttrs,obj2,parentTaskAttrs,null);
    }

    OAHGridBean hgrid=(OAHGridBean)webBean.findChildRecursive("HGridRN");
    OAHGridHierarchyBean hgridHierarchy = (OAHGridHierarchyBean)hgrid.findChildRecursive("TreeRN");
    OATreeLevelBean treeChild = (OATreeLevelBean)hgridHierarchy.findChildRecursive("TreeRN");


    OAWebBean nodeDef1 = (OAWebBean)treeChild.findChildRecursive("nodeDef1"); 
    nodeDef1.setViewUsageName("TestProjects1VO1");
    nodeDef1.setViewAttributeName("ProjectName");



    OATreeChildBean childNode1 = (OATreeChildBean)treeChild.findChildRecursive("childNode1"); 
    childNode1.setAttributeValue(VIEW_LINK_NAME,"TestPrjToTestTasksVL");
    childNode1.setAttributeValue(VL_ACCESSOR_NAME_ATTR,"TestPrjToTasksAcc");


    OAWebBean nodeDef2 = (OAWebBean)childNode1.findIndexedChild(childNode1,"nodeDef2"); 
    nodeDef2.setAttributeValue(VIEW_USAGE_NAME, "TestTasks1VO1");
    nodeDef2.setAttributeValue(VIEW_ATTRIBUTE_NAME,"TaskName");

    %%%%%%%%%%%%%%%Till Here grid is getting data%%%%%%%%%%%%

    This node is not getting data............i.e sub tasks are not getting data



    OATreeChildBean childNode2 = (OATreeChildBean)childNode1.findIndexedChildRecursive("childNode2"); 
    childNode2.setAttributeValue(VIEW_LINK_NAME,"TaskToTestTasksVL1");
    childNode2.setAttributeValue(VL_ACCESSOR_NAME_ATTR,"TaskToTasksAcc"); 
    OAWebBean nodeDef3 = (OAWebBean)childNode2.findIndexedChild(childNode2,"nodeDef3"); 
    nodeDef3.setAttributeValue(VIEW_USAGE_NAME, "TestRecTasks1VO1");
    nodeDef3.setAttributeValue(VIEW_ATTRIBUTE_NAME,"TaskName");

    Please help me ..
    Thanks
    Rama

  • 相关阅读:
    parser_url
    fsockopen
    MySql支持的数据类型
    MySql常用字符集
    MySQL各大存储引擎
    MySql数据库基础
    Python 流程控制 超全解析(不可错过)
    python 序列解包(解压缩)
    python常量 (最全常量解析)
    python内存管理(通俗易懂,详细可靠)
  • 原文地址:https://www.cnblogs.com/huanghongbo/p/4722291.html
Copyright © 2011-2022 走看看