Since we can't run your test case, we went through the process of putting together a simple standalone test case to see if setPickListFilterCriteriaFunction() was just broken in 6.1
It appears to be working fine.
Here's our test case. You can drop this into a new EntryPoint class in the Built-In DS sample, as we suggested, to see it in action.
It seems likely there's some other application bug in your usage which is causing the filtering to fail for you, but if you think there's a framework problem, we'd recommend modifying the starting point below to demonstrate the problematic usage sharing the result with us.
This will give us a runnable test case / complete set of code which we can meaningfully debug.
Thanks and Regards
Isomorphic Software
Code:
public class ComboCriteria61Issue implements EntryPoint {
@Override
public void onModuleLoad() {
DataSource supplyItem = DataSource.get("supplyItem");
ComboBoxItem fieldOne = new ComboBoxItem("foo");
fieldOne.setOptionDataSource(supplyItem);
fieldOne.setValueField("SKU");
fieldOne.setDisplayField("itemName");
fieldOne.setPickListFields(new ListGridField("itemName"), new ListGridField("units"));
fieldOne.setPickListFilterCriteriaFunction(itemContext -> {
Criteria criteria = new Criteria("units", "Ea");
return criteria;
});
DynamicForm testForm = new DynamicForm();
testForm.setFields(fieldOne);
testForm.draw();
}
}
Leave a comment: