This content has been marked as final. Show 5 replies
This is because you are not doing it correctly . You should not access the child view object instance separately. You should use access or relationship to create the rows.
DeptVOImpl deptVO=this.getDeptVO1(); DeptVORowImpl row=(DeptVORowImpl)deptVO.createRow(); deptVO.insertRow(row); //gets child accessor rowset RowIterator iterator= row.getEmpVO(); Number deptNumber=row.getDeptno().getSequenceNumber(); NameValuePairs nvps=new NameValuePairs(); nvps.setAttribute("Deptno", deptNumber); EmpVORowImpl empRow=(EmpVORowImpl)iterator.createAndInitRow(nvps); iterator.insertRow(empRow);
Thanks Ramandeep for quick reply.
The reason to create them separately, both vos gets pouplated individually by reading values from 2 webservices.
As I dont want to call the emp web service for each department I am trying above approach.
In this way, all the emp rows gets pulled in one call which reduces multiple calls to the service.
Please let me know if I am missing anything here.
So why don't you then populate all the master rows for the department and access it through an iterator and populate the child rows per department by copying from the other child view object.
All i am saying is that the approach is incorrect as the master's child rowset is different then the one you are populating and hence it would not work and that is the way the product works.
Thanks again Ramandeep.
I understand your point. I was thinking it should work as similar to that of query based vo.
I am trying this approach because we are populating the 2 vos rows by following this approach
"Using Programmatic View Objects for Alternative Data Sources" (http://sqltech.cl/doc/oas10gR31/web.1013/b25947/bcadvvo008.htm)
With your clarification I don't see a way to work it out, as populating rows is taken care by the framework.
Otherwise, I have to implement much of the copy rows logic which is a overhead.
Please suggest if any possible solution/pattern/sample for rendering hirarchical data.
Does it work with a query based VO? The approach is flawed and that is what it is ? I have seen users face this issue in production systems that were using your approach.
With your clarification I don't see a way to work it out, as populating rows is taken care by the framework.Hmm! it is taken care by framework alright if you follow the right approach.
"Using Programmatic View Objects for Alternative Data Sources" (http://sqltech.cl/doc/oas10gR31/web.1013/b25947/bcadvvo008.htm)That approach does not talk about master detail hierarchy and only tells you how to populate rows for individual view objects.