hi,
I have a problem in using comboBoxItem.setPickListFilterCriteriaFunction().
I have below code for a combo box at the beginning:
private final ComboBoxItem cbBusinessParty = new ComboBoxItem(
"businessPartyCode", "Business Party");
cbBusinessParty.setOptionDataSource(dsBusinessParty);
cbBusinessParty.setDisplayField("businessPartyMnemonic");
cbBusinessParty.setValueField("businessPartyCode");
Say the data source provides the below list of data
[
[“ABC”, “ABC”],
[“HELLO”, “HELLO”],
[“XYZ”, “XYZ”]
]
When i type character ‘H’ on the combo box field, the picklist will be shown and and display option “HELLO” only.
After i added the code for the default filtering in backend:
cbBusinessParty.setPickListFilterCriteriaFunction(new FormItemCriteriaFunction() {
@Override
public Criteria getCriteria(FormItemFunctionContext itemContext) {
final Criteria criteria = new Criteria();
criteria.addCriteria("roleTypeMnemonic", "FXMM");
return criteria;
}
});
After adding the code, the option list will be filtered as
[
[“ABC”, “ABC”],
[“HELLO”, “HELLO”]
]
When i type character ‘H’ on the combo box field, the picklist now is shown with all options “ABC” & “HELLO” instead of displaying “HELLO” only.
I have read the below doc
http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/form/fields/ComboBoxItem.html#getPickListFilterCriteria()
and use getFilterWithValue() to check.
It returns false no matter i added the code or not.
What is the solution to enable the filtering after i added the criteria function? Thanks