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