Thank you for this sample, very interesting.

Just for information, where do you instanciate DictionaryOnDemand?

In my case, I create it in the onModuleLoad method, because I need it
in view initialization, but the problem is that : because of deffered
command (but needed...), dictionnary is binded after view init....

Any idea?

Thank again,

--
ECH



On 2 déc, 11:13, obesga <[email protected]> wrote:
> ... maybe it's not .js file loaded when you create the dictionary.
> ( I thougth
>
> As in my test the behaviour works well, I thougth that when you do the
> getJsFile() method, the file was loaded into the browser ( even if the
> browser and the execution of js scripts must wait to the complete load
> of the file )
>
> But on production deployment sometimes I got the same exception; which
> I relsolved like this
>
>     public DictionaryOnDemand(String url,final String dname){
>         getJsFile(url);
>         DeferredCommand.addCommand(new Command(){
>              public void execute() {
>                    dictionary =  Dictionary.getDictionary(dname);
>              }
>        });
>     }
>
>     private native void getJsFile(String url) /*- {
>         var fileref = $doc.createElement('script');
>         fileref.setAttribute("type","text/javascript");
>         fileref.setAttribute("src", url);
>         $doc.getElementsByTagName("head")[0].appendChild(fileref)
>     } -*/;
>
> See if this help you
>
> Oskar
>
> On 1 dic, 15:27, bennyb <[email protected]> wrote:
>
> > I am still getting the errors:
>
> > [ERROR] Uncaught exception escaped
> > java.util.MissingResourceException: 'example' is not a JavaScript
> > object and cannot be used as a Dictionary
> >         at com.google.gwt.i18n.client.Dictionary.resourceErrorBadType
> > (Dictionary.java:100)
>
>

--~--~---------~--~----~------------~-------~--~----~
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