Announcement

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

    ListGrid field not udated in Group view

    SmartClient version 7.0rc2

    Steps to reproduce the problem:
    - create a ListGrid with server side data source (RestDataSource in my case) and with ListGrid.autoSaveEdits set to false
    - enable grouping, group by any field
    - edit the record
    - when an other field, not contained in groupByFields array, is changed, it's value is restored to the old value after executing ListGrid.saveAllEdits().
    - the ListGrid.originalData is changed correctly

    It seems that the ListGrid.data is not updated after the ListGrid.originalData is changed by ResultSet.updateCacheData() if a field not contained in ListGrid.groupByField is changed.

    The problem is probably in method ListGrid.dataChanged(), where ListGrid._markForRegroup is set (and ListGrid.regroup() is called) only in case the field from ListGrid.groupByField is changed.
    I haven't found any other place in the source code (except _incrementalRemap(), which is also not called in this case), where ListGrid.data gets sychronized with changes in ListGrid.originalData.

    I overloaded the dataChanged() method in my ListGrid derived class, and this solved the problem:

    Code:
    // force regroup if a field is changed;
    // SmartClient forces regroup only if field in groupByField array is changed
    // BUT: how it suppose to update a field not included in groupByField?
    // TODO: is this a SmartClient bug?
    dataChanged: function (type, originalRecord, rowNum, updateData)
    {
      var undefined;
    
      if (this.groupByField && type == "update") {
        var currData = (this.data.isGroupedOutput && this.originalData) ? this.originalData : this.data;
        var updatedRecord = currData.get(rowNum);
    
        for (var fieldName in originalRecord) {
          if (updatedRecord[fieldName] === undefined || !this.fieldValuesAreEqual(fieldName, originalRecord[fieldName], updatedRecord[fieldName])) {
            // XXX incrementalRegroup can handle this case, but more testing is 
            // necessary. change this post 7.0
            // this._incrementalRegroup(updatedRecord, originalRecord, rowNum, 
            //      updateData);
            this._markForRegroup = true;
            break;
          }
        }
      }
      this.Super("dataChanged", arguments);
    }
    So my question is: am I missing something or it is a SmartClient bug?

    Borut

    #2
    uploadfile

    Hello,
    Here, I want to add a browse button in my page create withe smartgwt, thank you for giving me how to save the image traveled in a given directory.
    thank you for answering my question.

    Comment


      #3
      Hi,

      I am using SmartClient Version: v8.2p_2012-05-29/EVAL Deployment, Internet Explorer 8.0 and I am new to SmartGWT.

      I am developing application which has inside Tab a Window , and inside this Window (which is "panel holder" in my application) I am displaying and destroying different V/HLayouts depending on the navigation selection. Majority of these Layouts have ListGrids. I am using addItem() and removeItem() to add and remove these Layouts from the “panel holder ”Window.

      Once I click couple times on different navigation option, during next edit inside any ListGrid, I get following error: ''this.data.isGroupedOutput' is null or not an object' in http://localhost:8080/pifs/pifs/sc/modules/ISC_Grids.js.

      Please help!!!!!!!!


      23:47:17.178 [ERROR] [pifs] 23:47:17.165:XRP7:WARN:Log:Error: ''this.data.isGroupedOutput' is null or not an object' in http://localhost:8080/pifs/pifs/sc/modules/ISC_Grids.js at line 3065
      ListGrid.regroup(_1=>undef) ListGrid.dataChanged(_1=>"add", _2=>undef, _3=>18, _4=>Array[1], _5=>undef) dataChangedObservation(operationType=>"add", originalRecord=>undef, rowNum=>18, updateData=>Array[1], filterChanged=>undef) ResultSet.$e0(_1=>undef) ResultSet.handleUpdate(_1=>"add", _2=>Array[1], _3=>false, _4=>Obj) ResultSet.dataSourceDataChanged(_1=>Obj, _2=>Obj) dataChangedObservation(dsResponse=>Obj, dsRequest=>Obj) DataSource.updateCaches(_1=>Obj, _2=>Obj) [c]DataSource.handleUpdate(_1=>Obj, _2=>Obj) DataSource.fireResponseCallbacks(_1=>Obj, _2=>Obj, _3=>Obj, _4=>Obj) DataSource.$65e(_1=>Array[1], _2=>Obj, _3=>Obj, _4=>Obj, _5=>Obj) DataSource.$76b(_1=>Obj, _2=>Array[1], _3=>Obj) [c]Class.fireCallback(_1=>Obj, _2=>"rpcResponse,data,rpcRequest", _3=>Array[3], _4=>[DataSource ID:lfm], _5=>undef) on [Class RPCManager] Class.fireCallback(_1=>Obj, _2=>"rpcResponse,data,rpcRequest", _3=>Array[3], _4=>undef) [c]RPCManager.__fireReplyCallback(_1=>Obj, _2=>Obj, _3=>Obj, _4=>Array[1]) [c]RPCManager.fireReplyCallbacks(_1=>Obj, _2=>Obj) [c]RPCManager.performOperationReply(_1=>Obj, _2=>Obj) [c]RPCManager.$67x(_1=>15) [c]RPCManager.performTransactionReply(_1=>15, _2=>"//isc_RPCResponseStart-->[{data:[{id:144..."[246], _3=>undef) callback(transactionNum=>15, results=>Obj, wd=>undef)
      "isc.RPCManager.performTransactionReply(transactionNum,results,wd)" ** recursed on [c]Class.fireCallback

      com.smartgwt.client.core.JsObject$SGWT_WARN: 23:47:17.165:XRP7:WARN:Log:Error: ''this.data.isGroupedOutput' is null or not an object' in http://localhost:8080/pifs/pifs/sc/modules/ISC_Grids.js at line 3065
      ListGrid.regroup(_1=>undef) ListGrid.dataChanged(_1=>"add", _2=>undef, _3=>18, _4=>Array[1], _5=>undef) dataChangedObservation(operationType=>"add", originalRecord=>undef, rowNum=>18, updateData=>Array[1], filterChanged=>undef) ResultSet.$e0(_1=>undef) ResultSet.handleUpdate(_1=>"add", _2=>Array[1], _3=>false, _4=>Obj) ResultSet.dataSourceDataChanged(_1=>Obj, _2=>Obj) dataChangedObservation(dsResponse=>Obj, dsRequest=>Obj) DataSource.updateCaches(_1=>Obj, _2=>Obj) [c]DataSource.handleUpdate(_1=>Obj, _2=>Obj) DataSource.fireResponseCallbacks(_1=>Obj, _2=>Obj, _3=>Obj, _4=>Obj) DataSource.$65e(_1=>Array[1], _2=>Obj, _3=>Obj, _4=>Obj, _5=>Obj) DataSource.$76b(_1=>Obj, _2=>Array[1], _3=>Obj) [c]Class.fireCallback(_1=>Obj, _2=>"rpcResponse,data,rpcRequest", _3=>Array[3], _4=>[DataSource ID:lfm], _5=>undef) on [Class RPCManager] Class.fireCallback(_1=>Obj, _2=>"rpcResponse,data,rpcRequest", _3=>Array[3], _4=>undef) [c]RPCManager.__fireReplyCallback(_1=>Obj, _2=>Obj, _3=>Obj, _4=>Array[1]) [c]RPCManager.fireReplyCallbacks(_1=>Obj, _2=>Obj) [c]RPCManager.performOperationReply(_1=>Obj, _2=>Obj) [c]RPCManager.$67x(_1=>15) [c]RPCManager.performTransactionReply(_1=>15, _2=>"//isc_RPCResponseStart-->[{data:[{id:144..."[246], _3=>undef) callback(transactionNum=>15, results=>Obj, wd=>undef)
      "isc.RPCManager.performTransactionReply(transactionNum,results,wd)" ** recursed on [c]Class.fireCallback
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
      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(Unknown Source)
      Last edited by radost; 21 Jun 2012, 07:12.

      Comment


        #4
        Anyone? Please help!

        Comment

        Working...
        X