protected void startFulltextSearch(final String queryString) {
readService.fulltextSearch(queryString, 0, 10, new AsyncCallback<ListQueryResult>() {
@Override
public void onSuccess(ListQueryResult result) {
if (null != result && result.getItemCount() > 0) {
final FulltextSuggestOracle o = emptySuggestOracle();
final Map<String, Integer> quicksearchLabels = new HashMap<String, Integer>();
for (final Dto a : result.getResults()) {
String label = a.getQuicksearch();
if (quicksearchLabels.containsKey(label)) {
quicksearchLabels.put(label, quicksearchLabels.get(label) + 1);
// add a counter for this label since it is not unique
label = label + " (" + quicksearchLabels.get(label) + ")";
} else {
quicksearchLabels.put(label, 1);
}
// insert this label into the name to id translation map to make sure that
// later the id can be determined by looking up the name in this map.
nameToDto.put(label, a);
o.add(label);
}
showSuggestionList();
}
}