Perhaps I'm doing something wrong, can I just extend
MultiWordSuggestOracle to do what I want by overriding
requestSuggestions ?  I tried doing so but I get the following error:

Unable to load module entry point class xxx (see associated exception
for details)
com.google.gwt.core.client.JavaScriptException: (TypeError): Object
doesn't support this property or method
 number: -2146827850
 description: Object doesn't support this property or method
        at com.google.gwt.user.client.ui.impl.FocusImplOld.createFocusable
(Native Method)
        at com.google.gwt.user.client.ui.MenuBar.init(MenuBar.java:861)
        at com.google.gwt.user.client.ui.MenuBar.<init>(MenuBar.java:181)
        at com.google.gwt.user.client.ui.SuggestBox$SuggestionMenu.<init>
(SuggestBox.java:163)
        at com.google.gwt.user.client.ui.SuggestBox.<init>(SuggestBox.java:
318)
        at com.google.gwt.user.client.ui.SuggestBox.<init>(SuggestBox.java:
301)
        at xxx.onModuleLoad(xxx.java:148)

Where xxx.java:148 is "_input = new SuggestBox(_tokenOracle);" and
_tokenOracle is the class which extends MultiWordSuggestOracle.  I
haven't done anything fancy with TokenOracle yet either:

public class TokenOracle extends MultiWordSuggestOracle {
  public TokenOracle() {
    super();
  }
  public TokenOracle(String whitespaceChars) {
    super(whitespaceChars);
  }
}

On Apr 18, 1:19 pm, Vitali Lovich <[email protected]> wrote:
> No - you need to write your own oracle.  The ones that are there are
> for simple examples to handle most cases.
>
> On Sat, Apr 18, 2009 at 5:21 AM, nevets1219 <[email protected]> wrote:
>
> > I was wondering what steps I should go about showing suggestions based
> > on the last token.  At first, I was thinking that I needed to specify
> > the white space but that doesn't seem to be the case (or maybe I have
> > used the incorrect white space).
>
> > Example:
>
> > I have the following words in the oracle: "cos, sin, tan"
>
> > I type "co" and choose "cos" but I continue typing so that I have "cos
> > (10) + t", I would like to now have it show "tan" as the suggestions.
>
> > I'm guessing I need to add .getTextBox().addChangeHandler(handler) and
> > extract the last token and then make a call .requestSuggestions
> > (request, callback).  The change handler seems relatively
> > straightforward but I'm actually not too sure about
> > the .requestSuggestions(...) part since I'm still relatively new to
> > GWT.
>
> > Also slightly related:  Is it appropriate to think of
> > MultiWordSuggestOracle.add("word") as
> > MultiWordSuggestOracle.createSuggestion("word", "word") ?
>
> > Thanks!
>
> > nevets1219
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to