Announcement

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

    ListGrid::getEditRow() Exception (Something other than an int was returned from JSNI)

    hi Isomorphic,

    after upgrade smartgwt 2.5 to 3.1 i get this JS Exception:
    *******
    Something other than an int was returned from JSNI method '@com.smartgwt.client.widgets.grid.ListGrid::getEditRow()': JS value of type undefined, expected int
    *******

    Log:
    Code:
     
    23:38:24.377 [ERROR] [builtinds] Exception occurred: 
    
    com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses
        at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
        at com.smartgwt.client.widgets.BaseWidget.fireEvent(BaseWidget.java:71)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        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.GeneratedMethodAccessor37.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        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:722)
    Caused by: com.google.gwt.dev.shell.HostedModeException: Something other than an int was returned from JSNI method '@com.smartgwt.client.widgets.grid.ListGrid::getEditRow()': JS value of type undefined, expected int
        at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266)
        at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt(ModuleSpace.java:247)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:75)
        at com.smartgwt.client.widgets.grid.ListGrid.getEditRow(ListGrid.java)
        at com.smartgwt.sample.client.BuiltInDS$4.onClick(BuiltInDS.java:120)
        at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.java:101)
        at com.smartgwt.client.widgets.events.ClickEvent.dispatch(ClickEvent.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:71)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        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.GeneratedMethodAccessor37.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        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:722)

    Please select a record in this testsample and then press the check button.

    Sample Code:
    Code:
     
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.core.client.GWT;
    import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
    import com.smartgwt.client.core.KeyIdentifier;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.types.Alignment;
    import com.smartgwt.client.util.KeyCallback;
    import com.smartgwt.client.util.Page;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.Canvas;
    import com.smartgwt.client.widgets.IButton;
    import com.smartgwt.client.widgets.events.ClickEvent;
    import com.smartgwt.client.widgets.events.ClickHandler;
    import com.smartgwt.client.widgets.events.DrawEvent;
    import com.smartgwt.client.widgets.events.DrawHandler;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.grid.ListGridRecord;
    import com.smartgwt.client.widgets.layout.HLayout;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    
    /**
     * Entry point classes define <code>onModuleLoad()</code>.
     */
    public class BuiltInDS implements EntryPoint {
    
    
        /**
         * This is the entry point method.
         */
        public void onModuleLoad() {
            KeyIdentifier debugKey = new KeyIdentifier();
            debugKey.setCtrlKey(true);
            debugKey.setKeyName("D");
    
            Page.registerKey(debugKey, new KeyCallback() {
                public void execute(String keyName) {
                    SC.showConsole();
                }
            });
            
    		GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
    
    			@Override
    			public void onUncaughtException(Throwable e) {
    				GWT.log("Exception occurred: ", e);
    			}
    		});
    
    
            final DataSource dataSource = ItemSupplyXmlDS.getInstance();  
            
            final ListGrid listGrid = new ListGrid() {  
                @Override  
                protected Canvas getExpansionComponent(final ListGridRecord record) {  
      
                    final ListGrid grid = this;  
                    VLayout layout = new VLayout(5);  
                    layout.setPadding(5);  
      
                    final DynamicForm df = new DynamicForm();  
                    df.setNumCols(4);  
                    df.setDataSource(dataSource);  
                    df.addDrawHandler(new DrawHandler() {  
                        public void onDraw(DrawEvent event) {  
                            df.editRecord(record);  
                        }  
                    });  
      
                    IButton saveButton = new IButton("Save");  
                    saveButton.addClickHandler(new ClickHandler() {  
                        public void onClick(ClickEvent event) {  
                            df.saveData();  
                        }  
                    });  
      
                    IButton cancelButton = new IButton("Done");  
                    cancelButton.addClickHandler(new ClickHandler() {  
                        public void onClick(ClickEvent event) {  
                            grid.collapseRecord(record);  
                        }  
                    });  
      
                    HLayout hLayout = new HLayout(10);  
                    hLayout.setAlign(Alignment.CENTER);  
                    hLayout.addMember(saveButton);  
                    hLayout.addMember(cancelButton);  
      
                    layout.addMember(df);  
                    layout.addMember(hLayout);  
                    return layout;  
                }  
            };  
      
            listGrid.setWidth(600);  
            listGrid.setHeight(500);  
            listGrid.setDrawAheadRatio(4);  
            listGrid.setCanExpandRecords(true);  
            listGrid.setAutoFetchData(true);  
            listGrid.setDataSource(dataSource);  
      
            ListGridField itemNameField = new ListGridField("itemName");  
            ListGridField skuField = new ListGridField("SKU");  
      
            listGrid.setFields(itemNameField, skuField);  
     
            listGrid.draw();
    
            
            
          IButton checkBtn = new IButton("Check");
          checkBtn.addClickHandler(new ClickHandler() {
              public void onClick(ClickEvent event) {
            	  
          		//TODO: check smartgwt 3.1
          		if  (listGrid.getEditRow() != -1) {
          			System.out.println("listGrid.getEditRow() - edit record found");
          		} else {
          			 System.out.println("listGrid.getEditRow() - NO!!! edit record found");;
          		}		
            	  
              }
          });
            
            
          checkBtn.draw();
            
          }
    }


    Used:
    OS: MacOS 10.8
    Browser: FF 9
    smartgwt: SNAPSHOT_v8.3d_2012-10-10/PowerEdition Deployment 2012-10-10
    gwt: 2.4

    best regards,
    timo

    #2
    Thanks for the update - we're looking into this

    Regards
    Isomorphic Software

    Comment


      #3
      I seem to have a similar issue with the 10/4 build - just wondering if there's been any traction on this yet?

      Comment


        #4
        It's assigned to a developer - we'll update this thread when its resolved.

        Comment


          #5
          This should be resolved in the next nightly build (Oct 22 or greater)

          Comment

          Working...
          X