Thursday, October 6, 2011

Re: Adding a collection of Suggestion to SuggestBox (replacement strings different from display strings)

You can't add suggestion objects directly, but you can override the createSuggestion(String replacementString, String displayString) method.

It will be called with the original string, passed into add(), and a displayString, which will have the search query terms highlighted with <strong> tags. You can then go ahead and modify the strings, and create and return a MultiWordSuggestion object which will be returned to the SuggestBox. 


On Thu, Oct 6, 2011 at 1:14 PM, Ice13ill <andrei.fifiita@gmail.com> wrote:
I also tried extending SuggestOracle, or Suggestion interface, but i
cannot access the methods needed or fields, because they have private
or default visibility. Is there something I'm missing ?

On Oct 5, 1:29 pm, Ice13ill <andrei.fifi...@gmail.com> wrote:
> Hello, I want to create a suggest box with suggestions that have
> replacement strings different from display strings
> I created acollectionof MultiWordSuggestion(replString,
> displayString) but i cannot find how to add them to the SuggestOracle.
> I have methods add(string) or addAll(stringCollection), and only
> setDefaultSuggestions(suggestionCollection).
> the oracle does not have a method addAll(Collection<Suggestion>
> suggestions) or add(Suggestions).
>
> So how do put suggestions with replacement strings different from
> display strings?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment