Announcement

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

    String cannot be cast to EditCompletionEvent error

    Release: Isomorphic SmartClient Framework (SC_SNAPSHOT-2011-11-
    16/PowerEdition Deployment 2011-11-16)

    We're getting the following error after applying this release:

    java.lang.String cannot be cast to com.smartgwt.client.types.EditCompletionEvent
    at com.smartgwt.client.widgets.grid.events.EditorExitEvent.getEditCompletionEvent(EditorExitEvent.java)

    Our code is as follows:

    Code:
    protected static final String ESCAPE = "escape";
    ...
    
    ListGridField componentItemNumber = new ListGridField(PACK_COMPONENT_ITEM_NUMBER);
    ...
    
    componentItemNumber.addEditorExitHandler(new EditorExitHandler() {
    
       @Override
       public void onEditorExit(final EditorExitEvent event) {
    
          if (ESCAPE==event.getEditCompletionEvent().getValue())
             return;				
          ...
       }
    });
    The error occurs in event.getEditCompletionEvent().getValue().

    It happens as the user exits a cell for a ListGrid.

    Any thoughts?

    Thanks

    #2
    This code doesn't look right - you're comparing a String and getValue() via == not .equals()?

    Comment


      #3
      Good and valid point, I should have noticed that but did not. Unfortunately, it doesn't solve the problem. Even though the == is useless, it still needs to get past the code where it's having the issue. The exception only occurs now that we've applied the new release.
      Thanks for the quick reply though!

      Comment


        #4
        A quick update to let you know one of our developers is scheduled to look at this. We should have an update later today or tomorrow.

        Comment


          #5
          We've found and resolved this issue. Please try the next nightly build from http://www.smartclient.com/builds. The fix should show up in the 3.x and 3.0.x branches going forward.

          Comment


            #6
            I still find the same error

            My code is this:

            Code:
            SC.say("Evento\n" +event.getEditCompletionEvent().getValue());
            The error in the console log is this:

            Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to com.smartgwt.client.types.EditCompletionEvent at com.smartgwt.client.widgets.grid.events.RowEditorExitEvent.getEditCompletionEvent(RowEditorExitEvent.java) at es.dia.pos.n2a.gwt.client.gui.merch_movements.quality_communications.QualityCommListTable$TableActionBase.onRowEditorExit(QualityCommListTable.java:109) at com.smartgwt.client.widgets.grid.events.RowEditorExitEvent.dispatch(RowEditorExitEvent.java:96) at com.smartgwt.client.widgets.grid.events.RowEditorExitEvent.dispatch(RowEditorExitEvent.java:1) at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1) at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40) at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193) at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88) at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127) at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218) 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.google.gwt.core.client.impl.Impl.apply(Impl.java) at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213) at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:662)


            Can you help me? I have tried all LGPL builds (3.0,3.1, 4.0) but no one solves the problem. In which version/build has been this issue solved?

            Comment


              #7
              The only variation of this issue that we know how to reproduce has been solved long ago for all the versions you're trying. So you should post a new, minimal, ready-to-run test case that reproduces the problem.

              Comment

              Working...
              X