How to create VO s and VLs dynamically in OAF

Source: Internet
Author: User

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's working for 1 level and not another leve. For Example. Grid ID displaying projects to tasks and 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 was not getting data............i.e sub tasks was 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

How to create VO s and VLs dynamically in OAF

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.