Announcement

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

    RestDataSource and startEditingNew

    Hello,

    We have an issue while updating our version of SmartGWT Power (My customer and myself still have a support contract with you and if you need more info you can just ask me)

    We were using : SmartClient Version: v9.1p_2014-12-05/PowerEdition Deployment (built 2014-12-05)
    And are now using : SmartClient Version : v9.1p_2015-12-05/PowerEdition Deployment (built 2015-12-05) => 4.1p20151205

    One of our screen is using a ListGrid with a RestDataSource; everything works fine with the last version but now we can't add new line using "StartEditingNew" and we are struggling with this error, with no way of knowing what&where something went wrong :
    Code:
    Exception occured in browser :
    (TypeError) : Cannot read property '0' of undefined
    Stacktrace :
    Unknown.wrap_2_g$(heliosweb-0.js@5:54165)
    Unknown.doFire_0_g$(heliosweb-0.js@20:43714)
    Unknown.fireEvent_2_g$(heliosweb-0.js@8:43790)
    Unknown.fireEvent_1_g$(heliosweb-0.js@24:43575)
    Unknown.fireEvent_5_g$(heliosweb-0.js@30:61058)
    Unknown.anonymous(heliosweb-0.js@16:239801)
    Unknown.apply_1_g$(heliosweb-0.js@28:14065)
    Unknown.entry0_0_g$(heliosweb-0.js@16:14124)
    Unknown.anonymous(heliosweb-0.js@14:14103)
    Unknown.obj_0_g$.addProperties.click(heliosweb-0.js@14:239810)
    Unknown.isc_StatefulCanvas_handleActivate(http://localhost:8084/heliosweb/sc/modules/ISC_Foundation.js@108:226)
    Unknown.isc_StatefulCanvas_handleClick(http://localhost:8084/heliosweb/sc/modules/ISC_Foundation.js@13:227)
    Unknown.isc_c_EventHandler_bubbleEvent(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@139:1402)
    Unknown.isc_c_EventHandler_handleClick(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@606:1275)
    Unknown.isc_c_EventHandler__handleMouseUp(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@26:1264)
    Unknown.isc_c_EventHandler_handleMouseUp(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@57:1258)
    Unknown.isc_c_EventHandler_dispatch(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@108:1475)
    Unknown.eval(eval at isc__makeFunction (http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@122:73)
    And this error pop after the first one :
    Code:
    Thu Dec 10 16:14:13 GMT+100 2015 com.mars.helios.heliosweb.client.HeliosUncaughtExceptionHandler
    SEVERE: Uncatched exception: (TypeError) : Cannot read property '0' of undefinedcom.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property '0' of undefined
        at Unknown.wrap_2_g$(heliosweb-0.js@5:54165)
        at Unknown.entry0_0_g$(heliosweb-0.js@20:14127)
        at Unknown.parentResized(heliosweb-0.js@14:14103)
        at Unknown.isc_Canvas__resolveChildPercentSizes(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@679:2213)
        at Unknown.isc_Canvas_layoutChildren(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@507:2213)
        at Unknown.isc_Canvas__completeResizeBy(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@13:2203)
        at Unknown.isc_Canvas_resizeBy(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@6:2201)
        at Unknown.isc_Canvas_resizeTo(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@932:2213)
        at Unknown.isc_Layout_resizeMembers(http://localhost:8084/heliosweb/sc/modules/ISC_Foundation.js@132:289)
        at Unknown.isc_Layout_layoutChildren(http://localhost:8084/heliosweb/sc/modules/ISC_Foundation.js@6:328)
        at Unknown.isc_Canvas__completeResizeBy(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@13:2203)
        at Unknown.isc_Canvas_resizeBy(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@6:2201)
        at Unknown.isc_Canvas_resizeTo(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@932:2213)
        at Unknown.isc_Layout_resizeMembers(http://localhost:8084/heliosweb/sc/modules/ISC_Foundation.js@108:289)
        at Unknown.isc_Layout_layoutChildren(http://localhost:8084/heliosweb/sc/modules/ISC_Foundation.js@6:328)
        at Unknown.isc_Canvas__completeResizeBy(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@13:2203)
        at Unknown.isc_Canvas_moveBy(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@193:2162)
        at Unknown.isc_Canvas_moveTo(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@106:2185)
        at Unknown.isc_Canvas_setRect(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@62:1978)
        at Unknown.isc_Canvas__resolvePercentageSize(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@7:2225)
        at Unknown.isc_Canvas_parentResized(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@371:2222)
        at Unknown.parentResized_0_g$(heliosweb-0.js@13:236695)
        at Unknown.<anonymous>(heliosweb-0.js@15:236640)
        at Unknown.apply_1_g$(heliosweb-0.js@28:14065)
        at Unknown.entry0_0_g$(heliosweb-0.js@16:14124)
        at Unknown.parentResized(heliosweb-0.js@14:14103)
        at Unknown.isc_Canvas__resolveChildPercentSizes(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@679:2213)
        at Unknown.isc_Canvas_layoutChildren(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@507:2213)
        at Unknown.isc_Canvas__completeResizeBy(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@13:2203)
        at Unknown.isc_Canvas_moveBy(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@193:2162)
        at Unknown.isc_Canvas_moveTo(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@106:2185)
        at Unknown.isc_Canvas_setRect(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@62:1978)
        at Unknown.isc_Canvas__resolvePercentageSize(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@7:2225)
        at Unknown.isc_Canvas_pageResize(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@171:2184)
        at Unknown.isc_c_Page_handleEvent(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@72:1161)
        at Unknown.isc_c_EventHandler__fireResizeEvent(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@85:1465)
        at Unknown.isc_c_EventHandler__pageResize(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@6:1465)
        at Unknown.isc_c_EventHandler__pageResizePollMethod(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@182:1462)
        at Unknown.isc_c_Class_fireCallback(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@78:285)
        at Unknown.isc_c_Timer__fireTimeout(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@200:1150)
        at Unknown.anonymous(http://localhost:8084/heliosweb/sc/modules/ISC_Core.js@40:1148)
    I'm not sure if I can create a standalone case for this one so, can you guys think of anything that might be the source of the issue ?
    Here is a quick sample of our code : sample.txt

    Thank you.
    Attached Files
    Last edited by Emilien; 10 Dec 2015, 07:15.

    #2
    Both of these are crashes somewhere in your application code, but you are looking at stack traces for obfuscated code. See the Debugging overview to see how to set up either SuperDevMode or classic Development Mode, so you can debug what's going wrong in your code.

    At that point, let us know if you think there is actually a framework issue at fault.

    Comment


      #3
      The stacktrace is from our code because it's handle by our UncaughtExceptionHandler but the breakpoint is trigger by "grid.startEditingNew();"

      Here is the stacktrace while using the SuperDevMode .. I'm not sure how I can help you understand this issue, it's really bugging me for 2 days now.

      Click image for larger version

Name:	Developer Tools - httplocalhost8084.jpg
Views:	138
Size:	192.9 KB
ID:	233254

      May I emphasises the fact that everything works fine with the 4.1p-2014-12-05, so I guess something changed in the startEditingNew() between thoses 2 versions :x
      Last edited by Emilien; 10 Dec 2015, 08:18.

      Comment


        #4
        With both the original trace and the SDM screenshot, it appears that you've got a click handler on some kind of button, and your click handler is crashing. Once your code in the click event crashes, *then* the UncaughtExceptionHandler is called.

        Note that if you look at the line when you've set a breakpoint, that line of code cannot actually crash. So that's definitely not the problem.

        You can easily verify this by just logging something right when your click handler is called, before you call any APIs that might crash.

        Comment


          #5
          Yup my click handler is crashing, here is the code of the click handler :

          Code:
            @Override     public void onClick(ClickEvent event) {
                       LOG.fine("on click");
                       grid.startEditingNew();  
                       LOG.fine("after click");  
                   }
          And if I remove the dataSource of the Grid, so new line is created on the grid and the edition is possible; this function ("StartEditingNew") appears to crash only when the grid is using a RestDatasource.

          Is there any way to debug inside the StartEditingNew to understand what is really happening and where is this null property ?
          Last edited by Emilien; 10 Dec 2015, 08:29.

          Comment


            #6
            startEditingNew() doesn't appear in the stack trace, so it appears your code crashes before ever calling that API. Perhaps "grid" is null.

            Comment


              #7
              I can assure you that grid is not null .. If I comment the "grid.setDataSource(ds);" everything works fine (except record from the database are not loaded in the grid, but the grid is editable fine) but when setting everything the startEditingNew don't seems to be able to work at all :
              Before executing startEditingNew: Click image for larger version

Name:	Developer Tools - httplocalhost8084.jpg
Views:	134
Size:	255.6 KB
ID:	233261

              After : Click image for larger version

Name:	Developer Tools - httplocalhost8084 - After.jpg
Views:	139
Size:	227.3 KB
ID:	233262

              Comment


                #8
                The stack trace makes it clear that startEditingNew() was never entered. One way or another, this indicates your environment is broken - either the trace is wrong, or some kind of GWT issue is occurring where there is a crash before startEditingNew() is actually invoked.

                At this point, you should try to shake out whatever is wrong with your environment: clear the GWT unitcache, rerun a GWT compile, restart the IDE, possibly reinstall GWT, possibly reboot. You could also try another developer's machine, and/or a fresh install of the whole toolchain.

                Note that, while there are instructions in the Debugging guide for how to run with debug modules so you can see the source of startEditingNew(), again all signs point to this method never being entered, so this probably a waste of time.

                Comment

                Working...
                X