We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using p-multiselect from primeng for filtering it sends values as an array. Because of that, it returns an empty array.
sending: "field":{"value":["value1","value2","value3"],"matchMode":"equals"} returns: []
"field":{"value":["value1","value2","value3"],"matchMode":"equals"}
[]
The text was updated successfully, but these errors were encountered:
Possible Solution In public class ColumnFilter add
private ArrayList<String> valuesToSearch; ... public ArrayList<String> getValuesToSearch() { return valuesToSearch; } .... public void setValueToSearch(JsonNode valueToSearch) { ArrayList<String> temp = new ArrayList<String>(); Iterator<JsonNode> rulesIter = valueToSearch.elements(); while (rulesIter.hasNext()) { temp.add(rulesIter.next().asText()); } this.valuesToSearch = temp; }
in Class SearchBuilder line 380
if (valueToSearch.isEmpty() && jsonFilter.get("value") instanceof ArrayNode) { columnFilter.setValueToSearch(jsonFilter.get("value")); }
in line 428 function getColumnQuery to
private String getColumnQuery(ColumnFilter cf, String fieldName) { String query = null; String rsqlFragment = getRsqlFragmentForMatchMode(cf.getMatchMode(), cf.getType()); if (cf.getType() != ColumnType.DATE && !cf.getValueToSearch().isEmpty()) { rsqlFragment = rsqlFragment.replace("[placeholder]", cf.getValueToSearch()); query = fieldName + rsqlFragment; } else if (cf.getType() != ColumnType.DATE) { List<String> res = new ArrayList<String>(); for (int i = 0; i < cf.getValuesToSearch().size(); i++ ) { String value = cf.getValuesToSearch().get(i); if (!value.isEmpty()) { res.add(fieldName + rsqlFragment.replace("[placeholder]", value)); } } query = "([values])"; query = query.replace("[values]", StringUtils.collectionToDelimitedString(res, " or ")); } else { query = getDatesQuery(cf, rsqlFragment, fieldName); } return query; } }
Sorry, something went wrong.
fix : Returns empty array when using p-multiSelect #31
2eaff86
nabildridi
No branches or pull requests
When using p-multiselect from primeng for filtering it sends values as an array. Because of that, it returns an empty array.
sending:
"field":{"value":["value1","value2","value3"],"matchMode":"equals"}
returns:
[]
The text was updated successfully, but these errors were encountered: