Announcement

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

    CubeGrid - RestDataSource: Added data not displayed

    Hi,

    I'm using an editable CubeGrid component to display data fetched from a JSON POSTMESSAGE RestDataSource using lazy loading (setAutoFetchData=true). The DataSource does not provide records for every displayed cell, since some facet combinations do not point to existing records.

    If I add a new record using the API, an "add" operation is sent to the source URL but the grid is not refreshed, the cell remains blank !

    It's working fine when the cell contains a value that was initially visible and the operation is rather an "update".

    I checked the response of my data source which replies successfully with the new record attributes.

    Here's the code of my update:

    Code:
          for (int[] cellCoord : cubeGrid.getCellSelection().getSelectedCells()) {
                final int row = cellCoord[0];
                final int col = cellCoord[1];
    
                Record cell = cubeGrid.getCellRecord(row, col);
    
                FacetValueMap facetMap = cubeGrid.getCellFacetValues(row, col);
    
                // Check empty record
                boolean addRecord = (cell == null);
                if (addRecord) {
                    cell = new CellRecord();
                    for (String facetId : facetMap.getFacetIds()) {
                        cell.setAttribute(facetId, facetMap.getMapping(facetId));
                    }
                }
    
                updateCellRecord(facetMap, cell, type, textItemValue);
    
                if (addRecord) {
                    cubeGrid.addData(cell);
                } else {
                    cubeGrid.updateData(cell);
                }
    
                cubeGrid.refreshCell(row, col);
            }
    If I update the cell manually, everything is fine: the add operation is executed remotely and the grid is refreshed....

    The only way I found to make the grid refresh is to call fetchData() after the updateData(...) call but it forces a complete refresh which is not what we want with a potentially big cube...

    Can you help me understand what's going on here ??

    Best regards,


    SmartGWT 3.1p Power Edition + Analytics nightly 2013-01-27
    GWT 2.5
    Chrome

    #2
    We've assigned an engineer to investigate the problem.

    Comment


      #3
      Additional issues on the CubeGrid

      Hi,

      As we developed further, we noticed a few things. I attached a source code snipped from a sample cube grid we use for internal testing.

      We added the setAutoSaveEdits(false) which fixes the original issue and allows us to apply all edits in a single JSON transaction.

      This solved some issues about the display, but introduced some issues with the edited values management and hasChanges flag...

      When doing manual edits in the grid some cells (we can't really find a pattern here) seem to have update issues...
      1) When edited manually with double click or F2, when we press enter the value is reset to the initial value. If we call hasChanges on the grid, it will report "false", and if we apply changes, no add/update will be generated.

      2) When edited manually, if we leave with tab or arrow, the value is updated in the cell, and we can keep inputing data. But when we exit the last cell with enter, this cell's value may be reset to its last remote value. If we call hasChanges on the grid, it will report mostly "false",but if we apply changes, a set of adds/updates will be generated consistently.

      We are using:
      GWT 2.5
      SmartClient Version: v8.3p_2013-01-28/PowerEdition Deployment (built 2013-01-28)
      Chromium/Chrome (latest)

      Our REST data sources have been used for months on listgrids and treegrids.
      We've been using CubeGrids for a while now, but with manual recordsets and it was mostly working fine. These issues only seem to appear when we are operating in read/write mode on a (rest?)datasource.

      I attached code samples and HTTP request samples.

      Let me know if I can provide anything more...
      Attached Files

      Comment


        #4
        As far as the intermittent issues with editing, if you are testing with Chrome in development mode, that would explain it. Development mode for Chrome is broken due to bugs in core GWT (see FAQ).

        Whether or not this is a development-mode-only issue, can you reproduce it with any other browser?

        Comment


          #5
          Hi,

          We're not using chrome development mode, it's really a raw Maven built war file deployed in a Tomcat 7 container.

          The exprience is consistent in all the browsers we tried:
          - Chrome / Chromium
          - Firefox 18/19
          - IE6

          Comment


            #6
            The sample code seems to include a lot of outside dependencies. Can you provide one that will run if simply dropped into our SDK. Either a modified SGWT showcase sample or something along the lines of .../samples/built-in-ds/src/com/smartgwt/sample/client/BuiltInDS.java.
            Last edited by Isomorphic; 11 Mar 2013, 11:21.

            Comment


              #7
              We have observed some of the issues you mention in our showcase and are making fixes. If you can provide the standlone sample, then we can ensure all issues are addressed

              Comment


                #8
                Hi,

                I'm currently working on providing a standalone portable Tomcat instance with our application so that you could try by yourself.

                You signed a NDA contract with my customer (see Lee for this) so I can send you the whole source code and this portable tomcat instance, but I need to send you a download URL privately.

                Is there a way for me to send you the links by email ?

                Best regards,

                Yannick

                Comment


                  #9
                  We've applied fixes to issues observed with CubeGrid editing to the SC 9.0d/SGWT 4.0d and SC 8.3p/SGWT 3.1p code streams, which will be in the next nightly build. These may address your situation.

                  Comment


                    #10
                    Hi,

                    I tried the latest nightly build, but I still experience the same manual data input issues.

                    For instance, I edited several values in my grid and logged the gridEdit logs from the admin screen:

                    Code:
                    10:43:48.716:TMR3:INFO:gridEdit:isc_HeliosCubeGrid_0:Starting editing at row 5, colNum 0
                    10:43:48.717:TMR3:INFO:gridEdit:isc_HeliosCubeGrid_0:establishing new edit session at row: 5, col:0 with values: {LastName: "Frot",
                    FirstName: "Alfred",
                    Period: "P01"}
                    10:43:48.718:TMR3:DEBUG:gridEdit:isc_HeliosCubeGrid_0:showing inline editor at: 5,0, will focus: true
                    10:43:48.720:TMR3:INFO:gridEdit:isc_HeliosCubeGrid_0_body:redraw with editors showing, editForm.hasFocus: false
                    10:43:52.016:KPR0:INFO:gridEdit:isc_HeliosCubeGrid_0:cellEditEnd: ending editing, completion event: enter
                    10:44:12.658:TMR8:INFO:gridEdit:isc_HeliosCubeGrid_0:Starting editing at row 5, colNum 1
                    10:44:12.660:TMR8:INFO:gridEdit:isc_HeliosCubeGrid_0:establishing new edit session at row: 5, col:1 with values: {LastName: "Frot",
                    FirstName: "Alfred",
                    Period: "P02"}
                    10:44:12.664:TMR8:DEBUG:gridEdit:isc_HeliosCubeGrid_0:showing inline editor at: 5,1, will focus: true
                    10:44:12.672:TMR8:INFO:gridEdit:isc_HeliosCubeGrid_0_body:redraw with editors showing, editForm.hasFocus: false
                    10:44:14.621:KPR7:INFO:gridEdit:isc_HeliosCubeGrid_0:cellEditEnd: ending editing, completion event: enter
                    10:44:16.358:TMR1:INFO:gridEdit:isc_HeliosCubeGrid_0:Starting editing at row 5, colNum 2
                    10:44:16.361:TMR1:INFO:gridEdit:isc_HeliosCubeGrid_0:establishing new edit session at row: 5, col:2 with values: {LastName: "Frot",
                    FirstName: "Alfred",
                    Period: "P03"}
                    10:44:16.365:TMR1:DEBUG:gridEdit:isc_HeliosCubeGrid_0:showing inline editor at: 5,2, will focus: true
                    10:44:16.370:TMR1:INFO:gridEdit:isc_HeliosCubeGrid_0_body:redraw with editors showing, editForm.hasFocus: false
                    10:44:17.358:KPR3:INFO:gridEdit:isc_HeliosCubeGrid_0:cellEditEnd: ending editing, completion event: enter
                    10:44:19.261:TMR5:INFO:gridEdit:isc_HeliosCubeGrid_0:Starting editing at row 4, colNum 2
                    10:44:19.261:TMR5:INFO:gridEdit:isc_HeliosCubeGrid_0:establishing new edit session at row: 4, col:2 with values: {LastName: "Einstein",
                    FirstName: "Alfred",
                    Period: "P03"}
                    10:44:19.263:TMR5:DEBUG:gridEdit:isc_HeliosCubeGrid_0:showing inline editor at: 4,2, will focus: true
                    10:44:19.265:TMR5:INFO:gridEdit:isc_HeliosCubeGrid_0_body:redraw with editors showing, editForm.hasFocus: false
                    10:44:23.129:KPR2:INFO:gridEdit:isc_HeliosCubeGrid_0:cellEditEnd: ending editing, completion event: enter
                    10:44:44.726:TMR4:INFO:gridEdit:isc_HeliosCubeGrid_0:Starting editing at row 0, colNum 1
                    10:44:44.727:TMR4:INFO:gridEdit:isc_HeliosCubeGrid_0:establishing new edit session at row: 0, col:1 with values: {LastName: "Arbogast",
                    FirstName: "Alfred",
                    Period: "P02"}
                    10:44:44.730:TMR4:DEBUG:gridEdit:isc_HeliosCubeGrid_0:showing inline editor at: 0,1, will focus: true
                    10:44:44.734:TMR4:INFO:gridEdit:isc_HeliosCubeGrid_0_body:redraw with editors showing, editForm.hasFocus: false
                    10:44:45.570:KPR4:INFO:gridEdit:isc_HeliosCubeGrid_0:cellEditEnd: ending editing, completion event: enter
                    10:44:45.575:KPR4:INFO:gridEdit:isc_HeliosCubeGrid_0:editor hiding at 0,1, no actual changes, dropping editSession
                    10:44:45.878:KPR4:WARN:Log:TypeError: Cannot read property '$24t' of undefined
                    Stack from error.stack:
                        ListGrid._clearEditValues() @ heliosweb/sc/modules/ISC_Grids.js:1576:369
                        ListGrid._saveAndHideEditor() @ heliosweb/sc/modules/ISC_Grids.js:1638:137
                        isc_ListGrid_cellEditEnd() @ heliosweb/sc/modules/ISC_Grids.js:1615:259
                        isc_ListGrid_editorKeyPress() @ heliosweb/sc/modules/ISC_Grids.js:698:6
                        isc.A.editFormDefaults.itemKeyPress() @ heliosweb/sc/modules/ISC_Grids.js:665:5745
                        FormItem._fireKeyPressHandlers() @ heliosweb/sc/modules/ISC_Forms.js:976:74
                        isc_FormItem_handleKeyPress() @ heliosweb/sc/modules/ISC_Forms.js:973:13
                        [a]MathFunction.invokeSuper() @ heliosweb/sc/modules/ISC_Core.js:247:93
                        [a]MathFunction.Super() @ heliosweb/sc/modules/ISC_Core.js:240:170
                        TextItem.handleKeyPress() @ heliosweb/sc/modules/ISC_Forms.js:1264:400
                    
                    10:44:49.678:KPR6:INFO:gridEdit:isc_HeliosCubeGrid_0:cellEditEnd: ending editing, completion event: enter
                    10:44:49.680:KPR6:INFO:gridEdit:isc_HeliosCubeGrid_0:creating new edit values for row: 0
                    10:44:49.786:KPR6:WARN:Log:Call to Super for method: setEditValue failed on: [CubeGrid ID:isc_HeliosCubeGrid_0]: couldn't find a superclass implementation of : ListGrid.setEditValue
                        [a]MathFunction.getStackTrace(_1=>undef, _2=>undef, _3=>undef, _4=>undef, _5=>undef)
                        [a]MathFunction.invokeSuper(_1=>null, _2=>"setEditValue", _3=>undef, _4=>undef, _5=>undef, _6=>undef, _7=>undef, _8=>undef, _9=>undef, _10=>undef)
                        [a]MathFunction.Super(_1=>"setEditValue", _2=>Array[3], _3=>undef)
                        isc_CubeGrid_setEditValue(_1=>0, _2=>1, _3=>"1", _4=>true, _5=>undef)
                        isc_ListGrid_storeUpdatedEditorValue(_1=>undef, _2=>undef)
                        CubeGrid.getEditValues(_1=>0, _2=>1)
                        isc_ListGrid_setEditValues(_1=>Array[2], _2=>Obj, _3=>true, undef, undef, undef, undef, undef)
                        ** recursed on [a]MathFunction.invokeSuper
                    
                    10:44:49.787:KPR6:INFO:gridEdit:isc_HeliosCubeGrid_0:establishing new edit session at row: 0, col:1 with values: {LastName: "Arbogast",
                    FirstName: "Alfred",
                    Period: "P02"}
                    10:44:49.788:KPR6:INFO:gridEdit:isc_HeliosCubeGrid_0:editor hiding at 0,1, no actual changes, dropping editSession
                    The first ones worked and then I got some issues... Sometimes I get simply a log about the fact that no update has been detected even if I actually changed the value. Some other times I get the exception you can see about the missing record.

                    Best regards,

                    SmartGWT 3.1p:
                    SmartClient Version: v8.3p_2013-03-12/PowerEdition Deployment (built 2013-03-12)
                    GWT 2.5
                    Chrome/Firefox (latest)

                    Comment


                      #11
                      Yesterday's build for SGWT 3.1p doesn't have the fixes; you'll need today's build, dated 2013-03-13.

                      Comment


                        #12
                        Seems to work MUCH better !!

                        I now have consistent highlights on updated values and updates seem to work 100%.

                        I'll spend some time today running more in-depth tests but it seems to be fixed.

                        Comment

                        Working...
                        X