Reputation: 122580
GWT's SuggestBox
shows a list of inputs that match what the user has already typed. Can the suggestion list items contain arbitrary HTML or widgets instead of just strings? For example, I'd like to show an icon with some suggested items.
Upvotes: 4
Views: 1183
Reputation: 925
Simple answer - yes, the suggestions can contain arbitrary HTML - just put this in the suggestion implementation for your SuggestOracle. For example:
public class CountrySuggestion implements Suggestion {
..snip..
@Override
public String getDisplayString() {
return "<i>" + country.getName() + "</i><img src='icon.png'>";
}
}
Upvotes: 4