I'm trying to pass a parameter by method cal in a bounded task between two pages: departments and employees, and I'm trying to make employees filter by departmentId. I have a criteria view on employees doing this filter with a Bind Variable vcDeptId and in java:
public void applyViewCriteria(int id)
{
ViewCriteria vc = getViewCriteria("EmployeesViewFilterByDeptCriteria");
setvcDepartmentId(id);
applyViewCriteria(vc);
executeQuery();
}
On the Departments page I have a table with a button that redirects to the method call:
public void filter()
{
BindingContext bindingContext = BindingContext.getCurrent();
DCDataControl dc = bindingContext.findDataControl("AppModuleDataControl");
AppModuleImpl appM = (AppModuleImpl )dc.getDataProvider();
Object id =appM.getDepartmentsView1().getCurrentRow().getAttribute("DepartmentId");
appM.getEmployeesView2().applyViewCriteria(Integer.parseInt(id.toString()));
System.err.println(id);
}
It turns out that when you go to the employees page, the table doesn't filter, it shows all employees from all departments. I can see in the console that I get the id but I can't do the filter. I don't understand what's missing.. Can someone help me, please??
