Announcement

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

    Grid with one row error saving/discarding

    I am using SmartGWT 2.2 and Firefox 3.6.10.
    We are having issue when grid have only one row and 1 editable cell. It is causing JS error when I save or discard this row with very similar error "this.$69m is undefined ".
    I just tested adding a second row and both save and discard working OK.

    1. If we call discardAllEdits, nothing happens and row stays with edited data.
    I tried to replace edited value with original value from record, but the call to
    get original value coming back as null:

    Code:
    String temp = Grid.getRecord(0).getAttributeAsString("fname");
    When I tried to call discardEdits(0, rateFieldNum) just for 1 row, but its causing JS error (I tried for rownum = 0 or 1) :

    00:42:36.185 [ERROR] 15:10:06.477:TMR4:WARN:Log:TypeError: this.$69m is undefined
    ListGrid._clearingInactiveEditorHTML(0, 0)
    ListGrid.refreshCell(_1=>0, _2=>0, _3=>true)
    ListGrid.refreshRow(_1=>0)
    ListGrid.hideInlineEditor(_1=>undef)
    ListGrid._killEdit(1284577723039, "programmatic")
    ListGrid.discardEdits(_1=>0, _2=>1)
    unnamed(0, 1)
    unnamed()
    unnamed([object GWTJavaObject], 7864321, [object GWTJavaObject])
    unnamed(true)

    [c]Class.fireCallback(_1=>function (value), _2=>"value", _3=>[object Array], _4=>{Obj}, _5=>undef)
    [c]Class.fireCallback(_1=>function (value), _2=>"value", _3=>[object Array])
    [c]Class.fireCallback(_1=>{Obj}, _2=>undef, _3=>[object Array], _4=>{Obj}, _5=>true)
    Timer._fireTimeout("$ir306")
    unnamed()
    unnamed()
    .......................etc...


    2. the very similar problem is when I am saving this row to DB. The data is saved, but I am again getting JS error :

    00:00:59.654 [ERROR] Uncaught exception escaped
    com.google.gwt.core.client.JavaScriptException: (TypeError): this.$69m is undefined
    fileName:http://127.0.0.1:8888/rs.Application...s/ISC_Grids.js
    lineNumber: 1296
    stack: isc_ListGrid__clearingInactiveEditorHTML(0,0)@http://127.0.0.1:8888/rs.Application/sc/modules/ISC_Grids.js:1296
    isc_ListGrid_refreshCell(0,0,true)@http://127.0.0.1:8888/rs.Application/sc/modules/ISC_Grids.js:1703
    isc_ListGrid_refreshRow(0)@http://127.0.0.1:8888/rs.Application/sc/modules/ISC_Grids.js:1717
    isc_ListGrid_hideInlineEditor((void 0))@http://127.0.0.1:8888/rs.Application/sc/modules/ISC_Grids.js:1620
    isc_ListGrid__killEdit(1284661688649,"programmatic")@http://127.0.0.1:8888/rs.Application/sc/modules/ISC_Grids.js:1893
    isc_ListGrid_discardEdits(0,null,(void 0))@http://127.0.0.1:8888/rs.Application/sc/modules/ISC_Grids.js:1940
    isc_ListGrid_discardAllEdits()@http://127.0.0.1:8888/rs.Application/sc/modules/ISC_Grids.js:1936
    isc_ListGrid_setData([object Array])@http://127.0.0.1:8888/rs.Application/sc/modules/ISC_Grids.js:959
    isc_Class_setProperties([object Object])@http://127.0.0.1:8888/rs.Application/sc/modules/ISC_Core.js:346
    isc_Class_setProperty("data",[object Array])@http://127.0.0.1:8888/rs.Application/sc/modules/ISC_Core.js:344
    ("data",[object Array])@http://127.0.0.1:8888:163 @:0
    ([object GWTJavaObject],4456449,[object GWTJavaObject],[object Array],
    [object GWTJavaObject])@http://127.0.0.1:8888/rs.Application/hosted.html?rs_Application:56 ([object Object],
    [object Array],[object Object])@http://127.0.0.1:8888:94
    ((function (dsResponse, data, dsRequest) {var responseJ = __gwt_makeJavaInvoke(1)(null, 4325457, dsResponse);
    var requestJ = __gwt_makeJavaInvoke(1)(null, 4391033, dsRequest);if (callback != null) {__gwt_makeJavaInvoke(3)
    (callback, 4456449, responseJ, data, requestJ);}}),
    [object Object],[object Object])@http://127.0.0.1:8888:57 @:0
    Last edited by ggedal; 22 Sep 2010, 12:04.

    #2
    I was able to find a solution for DiscardAllEdits with only 1 row :

    Code:
    int [] changedRows = tempGrid.getAllEditRows();
    tempGrid.discardAllEdits(changedRows,true);
    I tried the similar approach with saveAllEdits(Function callback, int[] rows), but still get the same error as before .

    Comment


      #3
      Unfortunately this stack trace doesn't suggest much other than it being some kind of lifecycle issue. Try providing more information or sample code, ideally, a standalone test case we can run to see the error.

      Upgrading to the latest nightly might also reveal that the problem has already been fixed.

      Comment


        #4
        We identified this error as not part of the save, but rather part of the re-fresh after save, when we are trying to re-retrieve data in the grid.

        So the code grid.setData(response.getData()) would go into this JS error. We also tried to refresh just this one row but getting the same error, so for now we are just skipping this re-fresh if grid has only one row :

        Code:
        public void refreshGrid(final ListGrid grid) {
        
         grid.getDataSource().setShowPrompt(false);
         grid.getDataSource().fetchData(new Criteria(), new DSCallback() {
        
        public void execute(DSResponse response, Object rawData,DSRequest request) {
        
        if (grid.getTotalRows() > 1 ) {
          grid.setData(response.getData());
        else {
        //grid.refreshRow(0); //even this still causing JS error
        }

        Comment


          #5
          Unfortunately, this still doesn't suggest much. The best we can tell you is that it looks like you are doing something with the inline editing system at an invalid time. For example, you might be trying to initiate editing or establish edit values while data is still loading - you can determine that you are in this state by calling lengthIsKnown() on the ResultSet that is created when fetchData() is called.

          Comment

          Working...
          X