Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    problem using smart gwt 3.0 with minor changes to a project from showcase

    I am using Smart GWT 3.0- specifically I am working with the rotate sample that uses drawing class.

    I have changed the triangle drawn, and instead want to show a image in its place- I want this image to rotate in the same way as the other shapes are rotated when the user clicks on slider ( as shown in showcase)

    There is no error shown in eclipse after I have modified the code and saved it.

    I have changed the triangle shape code and replaced it with the following--


    DrawImage drawImg= new DrawImage();
    drawImg.setSrc("other/earth.png");
    drawImg.setDrawPane(drawPane);
    drawImg.setLeft(100);
    drawImg.setHeight(100);
    drawImg.draw();


    However an "Uncaught Exception" error is shown when I run GWT Dev mode and try to see the html page containing the drawings.

    Given below is the error I get in Google Chrome when the app fails to run--

    onModuleLoad() threw an exception
    Exception while loading module com.arvindikchari.bspinner.client.Spinner. See Development Mode for details.

    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
    at java.lang.Thread.run(Unknown Source)
    Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): Cannot call method 'create' of undefined
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.smartgwt.client.widgets.drawing.DrawPane.create(DrawPane.java)
    at com.smartgwt.client.widgets.BaseWidget.getOrCreateJsObj(BaseWidget.java:361)
    at com.smartgwt.client.widgets.layout.Layout.addMember(Layout.java:1153)
    at com.arvindikchari.bspinner.client.Spinner.onModuleLoad(Spinner.java:244)
    ... 9 more





    What do I have to do to correct this error?
    Regards,
    Arvind.

    #2
    FF10.0.2
    SmartClient Version: v8.2p_2012-04-30/LGPL Development Only (built 2012-04-30)

    Code:
    public void onClick(ClickEvent event) {
    	x = event.getX() - drawPane.getLeft();
    	y = event.getY() - drawPane.getTop();
    	DrawImage img = new DrawImage();
    	img.setDrawPane(drawPane);
    	img.setSrc("[SKIN]/RecordEditor/check.gif");
    	img.setLeft(x);
    	img.setTop(y);
    	img.setHeight(16);
    	img.setWidth(16);
    	img.draw();
    }

    Comment


      #3
      arvindikchari: your report suggests you just don't have the Drawing module included properly. Make sure you have <inherits name="com.smartgwt.Drawing"/> in your .gwt.xml file, just before your entry-point definition. If that doesn't get things working, do a full GWT compile and fully clear your browser cache.

      pboysen: there was an issue with images specified using [SKIN]-like relative paths - this has been addressed in 3.0p and 3.1d. Please retest with a nightly after 5/25

      Comment

      Working...
      X