I am working with ADF master detail concept.
Header form (master page)
Detail form (Detail page of Header (master page))
SubDetail form (Detail page of Detail (master page))
So:
Header page has h_id as primary key.
Detail page has d_id(Detail) and h_id(Header) as primary key.
SubDetail page has s_id (subDetail),d_id(Detail) and h_id(Header) as a primary key.
Once I will navigate from header page to detail page and after doing any insert or update, the table will be refreshed and will fetch details of first row of the table.
I tried two approaches:
First one, get the binding of the header VO and set the rowkey of setCurrentRowWithKeyValue
with header h_id
value:
BindingContainer parent_binding =getBindingsContOfOtherPage("view_headerPageDef");
OperationBinding opt =parent_binding.getOperationBinding("setCurrentRowWithKeyValue");
opt.getParamsMap().put("rowKey",h_Id);
opt.execute();
As it is finding h_id
only for detail (d_id), this will work.
But From detail, when I am navigating to subdetail page, the above concept is not working. It's not fetching the subdetail for current row of detail. It's fetching for first row only.
I assumed, that here subdetail requires both detail (d_id) and header (h_id). But I don't know how to put both values together in rowKey attribute.
Another approach I tried is to get the key of the currentRow in VO and set it programmatically:
BindingContainer bindings = getBindings();
BindingContainer parent_binding =getBindingsContOfOtherPage("view_DetailPageDef");
DCIteratorBinding child_dciter = (DCIteratorBinding)bindings.get("SubDetail_VO2Iterator");
DCIteratorBinding parent_dciter = (DCIteratorBinding)parent_binding.get("detail_VO2Iterator");
Key DetailKey=dciter1.getCurrentRow().getKey();
Key parentKey=parent_dciter.getCurrentRow().getKey();
parent_dciter.setCurrentRowWithKey(parentKey.toStringFormat(true));
dciter1.setCurrentRowWithKey(DetailKey.toStringFormat(true));
But this concept will also work at header and detail level. It is not working for detail and subdetail level.
I am getting Null Pointer Exception at getCurrentRow().getKey()
.
How can I achieve this?