Wednesday 7 August 2013

ADF : ViewCriteria: ViewCrietiria applied on ViewLink of ApplicationModule



ViewCrietiria applied on ViewLink of ApplicationModule and dragged as Tree on UI.



Hi All,

I have View Link , for child ViewCritiria is applied.

Eg : DeprtmentVO
|_
EmployeeVO (Applied ViewCritiria)

I am using this view link as Tree table on my UI (The ViewCritiria is not working on child)

but if i use the same link as maste detail table (View Critiria will work on table).

Attached are the 2 files
1. How i am applying ViewCritiria on child
2. How VC is working for Table, and not working for Tree.
------------In VOImpl -> we have to override the below function------------------------------
@Override
public void prepareRowSetForQuery(ViewRowSetImpl vrs, Row[] rows)
{
Boolean isMktImpChildInstance = false;
String viewInstanceName = this.getViewObject().getName();
//isParent checks if the VO is used for fetching only the root territories
isMktImpChildInstance = ("DepartmentROVO_EmployeeROVO_Dept_Empl_Link_EmployeeROVO".equals(viewInstanceName));
//If the logged in user is enterprise admin, fetch only the global territory
if (isMktImpChildInstance)
{
ViewCriteria vc1 = this.getViewCriteria("EmployeeIDROVOCriteria");
vc1.setUseBindVarsForLiterals(false);
this.applyViewCriteria(vc1, true);
}
super.prepareRowSetForQuery(vrs,rows);
}

No comments:

Post a Comment