It seems that you are calling the exported stuff before it is available. Note that GWT loads the appropriate permutation asynchronously. So either enclose your js code in your html page in a method and call it from your onModuleLoad, or delay the execution of your code.
On Mon, Jan 14, 2013 at 4:02 PM, samira DAHMANI <[email protected]>wrote: > I'm new to gwt-exporter and i am trying to export a simple gwt composite > but when I compile the code it doesn't generate any new javascript lib or > file as expected. When I run it I get > > Uncaught ReferenceError: jsc is not defined . > > Here is my code, can you help me to know what's wrong with it? > > The composite : > > @Export@ExportPackage("jsc")public class MyClassicalLoginWidget extends > Composite implements Exportable{MyClientBundel bundle = > MyClientBundel.INSTANCE; > > @Exportpublic MyClassicalLoginWidget(){ > bundle.css().ensureInjected(); > > FlowPanel mainPanel = new FlowPanel(); > mainPanel.setStyleName(bundle.css().mainPanel()); > SuggestBox logintb = new SuggestBox(); > logintb.getElement().setAttribute("placeHolder", "Enter Your Login"); > logintb.setStyleName(bundle.css().textBox()); > PasswordTextBox pwdtb = new PasswordTextBox(); > pwdtb.setStyleName(bundle.css().textBox()); > Button connectbtn = new Button("Connexion"); > connectbtn.setStyleName(bundle.css().button()); > > mainPanel.add(logintb); > mainPanel.add(pwdtb); > mainPanel.add(connectbtn); > > initWidget(mainPanel); > } > > @Export > public void sayHello(){ > Window.alert("MyClassicalLoginWidget says hello"); > }} > > The EntryPoint: > > public class Main implements EntryPoint { > > public void onModuleLoad() { > ExporterUtil.exportAll(); > GWT.create(MyClassicalLoginWidget.class); > }} > > The javascript: > > <script type="text/javascript"> > var widget = new jsc.MyClassicalLoginWidget(); > widget.sayHello(); > </script> > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-web-toolkit/-/YQ7JSiVcrtUJ. > 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. > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
