Announcement

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

    Scrolling CubeGrid throws an Error : Uncaught RangeError: Maximum call stack size exceeded

    Hello,

    We have serious problem using CubeGrid.

    Our Environment :
    1. SmartGWT Version : 6.1p Build : 2019-06-06 (SmartGWTEE Enterprise)
    2. SmartClient Version : 11.1p_2019-06-06
    3. Browser : Version 74.0.3729.157 (Official Build) (64-bit), Mozilla Firefox 60.6.3esr (64-bit)
    4. OS : openSUSE Leap 15.
    5. Database : Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production


    Source Code:

    A.) We have Column Headers named - Steps (We don't need any expand or collapse functionality).
    Also We have 2 step Tree in row headers named - Addresses And Boxes .
    Our Column & Row header facets Class looks like :

    Code:
    public class BuildingInstallFacets {
    
        public static Facet[] getFacets(Record headers[], Record treeData[]) {
    
            Console.log("headers.length = " + headers.length + ", treeData.length = " + treeData.length);
    
            // Steps
            Facet step = new Facet();
            step.setId("step_id");
            step.setTitle("Step");
            step.setIsTree(false);
            step.setCollapsed(false);
            step.setHeight(140);
    
            List<FacetValue> stepList = new ArrayList<>();
            for (Record header : headers) {
                String stepTitle = header.getAttributeAsString("step_title");
                stepTitle = "<div class=\"rotate3\">"+stepTitle+"</div>";
                String id = header.getAttributeAsString("id");
                FacetValue stepElement = new FacetValue(id, stepTitle);
                stepElement.setWidth(70);
                stepList.add(stepElement);
            }
    
            step.setValues(stepList.toArray(new FacetValue[0]));
    
            // Addresses And Boxes
            Facet addressAndBox = new Facet();
            addressAndBox.setId("address_or_box_id");
            addressAndBox.setTitle(CCareFE.constants.addressesBoxesAndSteps());
            addressAndBox.setAlign(Alignment.CENTER);
            addressAndBox.setIsTree(true);
            addressAndBox.setCollapsed(false);
            addressAndBox.setCanCollapse(true);
            addressAndBox.setWidth(375);
            addressAndBox.setHeight(250);
    
            List<FacetValue> addrAndBoxList = new ArrayList<>();
            for (Record addrAndBox : treeData) {
    
                String globalid = addrAndBox.getAttributeAsString("globalid");
                String treeTitle = addrAndBox.getAttributeAsString("treeTitle");
                String addresspointid = addrAndBox.getAttributeAsString("addresspointid");
    
                FacetValue addrAndBoxElement = new FacetValue(globalid, treeTitle, addresspointid);
    
                addrAndBoxList.add(addrAndBoxElement);
            }
    
            addressAndBox.setValues(addrAndBoxList.toArray(new FacetValue[0]));
    
            return new Facet[]{step, addressAndBox};
        }
    }
    B.) CubeGrid Components Looks Like :

    Code:
    CubeGrid advancedCube = new CubeGrid();
    advancedCube.setAlternateRecordStyles(true);
    advancedCube.setShowRecordComponents(true);
    advancedCube.setShowRecordComponentsByCell(true);
    advancedCube.setAutoFetchData(true);
    advancedCube.setEmptyCellValue("0");
    advancedCube.setFacets(BuildingInstallFacets.getFacets(headers, treeData));
    advancedCube.setDataSource(DataSource.get("BuildingInstallDataDS"));
    advancedCube.setFetchOperation("findAllData");
    advancedCube.setValueProperty("value");
    advancedCube.setCellIdProperty("id");
    advancedCube.setRowFacets("address_or_box_id");
    advancedCube.setColumnFacets("step_id");
    advancedCube.setCanHover(true);
    advancedCube.setShowCellContextMenus(true);
    
    advancedCube.setHoverCustomizer(new HoverCustomizer() {
        public String hoverHTML(Object value, ListGridRecord record, int rowNum,
                                int colNum) {
            if (record != null) {
                return "cell value: " + record.getAttribute("value")
                        + "<br>cell ID: " + record.getAttribute("id");
            }
            return null;
        }
    });
    
    advancedCube.setHoverHeight(20);
    advancedCube.setHoverWidth(150);
    advancedCube.setCanCollapseFacets(true);
    advancedCube.setCanMinimizeFacets(true);
    advancedCube.setAutoSelectValues(AutoSelectionModel.BOTH);
    advancedCube.setWrapFacetTitles(true);
    advancedCube.setFacetTitleAlign(Alignment.CENTER);
    advancedCube.setWrapFacetValueTitles(true);
    advancedCube.setWrapCells(true);
    advancedCube.setWrapHeaderTitles(true);
    advancedCube.setCellHeight(35);
    advancedCube.setAutoSizeHeaders(true);
    advancedCube.setRowHeaderGridMode(true);
    advancedCube.setCanMoveFacets(true);
    gridWrapperLayout.addMember(advancedCube);
    gridWrapperLayout.redraw();
    C.) Columns Header Facet Datasource :
    Code:
    <DataSource
            ID="BuildingInstallStepDS"
            serverType="sql"
            tableName="ccare.building_install_steps"
            qualifyColumnNames="false"
            dropExtraFields = "false">
        <fields>
            <field name="id"                 type="number"         title="id"           hidden="true"   primaryKey="true" />
            <field name="step_title"         type="text"              title="step_title"/>
        </fields>
    
        <operationBindings>
    
            <operationBinding operationId="getAllSteps" operationType="fetch">
                <selectClause><![CDATA[
                    t.id,
                    t.step_title
                 ]]>
                </selectClause>
                <tableClause><![CDATA[
                       ccare.building_install_steps t
                ]]>
                </tableClause>
                <whereClause><![CDATA[
                    1 = 1
                ]]>
                </whereClause>
            </operationBinding>
    
        </operationBindings>
    </DataSource>
    D.) Rows Header Facet Datasource :

    Code:
    <DataSource
            ID="GIS_AddressPointsDS"
            serverType="sql"
            dbName="GisOracle"
            tableName="sde.address_points"
            qualifyColumnNames="false"
            dropExtraFields = "false">
        <fields>
            <field name="globalid"       type="text"           title="globalid"             hidden="true"   primaryKey="true" />
            <field name="address"        type="text"          title="address"/>
            <field name="boxnumber"          type="text"          title="boxnumber"/>
            <field name="addresspointid"    type="text"          title="addresspointid"/>
            <field name="treeTitle"          type="text"          title="treeTitle"/>
            <field name="addresspointid"    type="text"          title="addresspointid"          hidden="true"   foreignKey="GIS_AddressPointsDS.globalid"   detail="true"/>
        </fields>
    
        <operationBindings>
    
            <operationBinding operationId="findAddressPoints" operationType="fetch" serverMethod="findAddressPoints">
                <serverObject lookupStyle="new" className="com.magti.billing.webui.server.impl.dmi.buildinginstall.DMIBuildingInstall"/>
            </operationBinding>
    
    
        </operationBindings>
    </DataSource>
    E.) CubeGrid table Datasource :
    Code:
    <DataSource
            ID="BuildingInstallDataDS"
            serverType="sql"
            tableName="ccare.building_install_data"
            qualifyColumnNames="false"
            dropExtraFields = "false">
        <fields>
            <field name="id"                 type="number"         title="id"           hidden="true"   primaryKey="true" />
            <field name="step_id"            type="number"        title="step_id"/>
            <field name="address_or_box_id"        type="text"              title="address_or_box_id"/>
            <field name="value"                    type="text"              title="value"/>
        </fields>
    
        <operationBinding operationId="findAllData" operationType="fetch">
            <selectClause><![CDATA[
                    t.id,
                    t.step_id,
                    t.address_or_box_id,
                    t.value
                 ]]>
            </selectClause>
            <tableClause><![CDATA[
                       ccare.building_install_data t
                ]]>
            </tableClause>
            <whereClause><![CDATA[
                        $defaultWhereClause
                ]]>
            </whereClause>
        </operationBinding>
    
    </DataSource>
    Problem :

    When we the CubeGrid is drawing everything is perfect. But when I am scrolling down to the bottom of the CubeGrid in the middle of the grid we have got an error :

    Code:
    Uncaught RangeError: Maximum call stack size exceeded
        at _3.isc_CubeGrid_getTotalRows (ISC_Analytics.js?isc_version=11.1p_2019-06-06.js:118)
        at _3.eval [as getTotalRows] (eval at isc__makeFunction (ISC_Core.js?isc_version=11.1p_2019-06-06.js:1), <anonymous>:4:61)
        at _3.isc_GridRenderer_getDrawArea [as getDrawArea] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:193)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:295)
        at _3.isc_c_Class_Super [as Super] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:287)
        at _3.getDrawArea (ISC_Analytics.js?isc_version=11.1p_2019-06-06.js:38)
        at _3.isc_GridRenderer__getTableHTMLDrawArea [as $121d] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:329)
        at _3.isc_GridRenderer__updateVirtualScrolling [as $193d] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:248)
        at _3.isc_GridRenderer_getTableHTML [as getTableHTML] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:253)
        at _3.isc_GridRenderer_getInnerHTML [as getInnerHTML] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:182)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:295)
        at _3.isc_c_Class_Super [as Super] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:287)
        at _3.isc_GridBody_getInnerHTML [as getInnerHTML] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:644)
        at _3.isc_Canvas__getInnerHTML [as $px] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:2517)
        at _3.isc_Canvas__updateInnerHTML [as $rd] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:2629)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:295)
        at _3.isc_GridRenderer__updateInnerHTML [as $rd] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:223)
        at _3.isc_Canvas__updateHTML [as $ra] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:2621)
        at _3.isc_Canvas_redraw [as redraw] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:2614)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:295)
        at _3.isc_GridRenderer_redraw [as redraw] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:598)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:295)
        at _3.isc_GridBody_redraw [as redraw] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:695)
        at _3.isc_GridRenderer_redrawOnScroll [as redrawOnScroll] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:219)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:295)
        at _3.isc_c_Class_Super [as Super] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:287)
        at _3.isc_GridBody_redrawOnScroll [as redrawOnScroll] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:705)
        at _3.isc_CubeGrid_syncHeaderScrolling [as syncHeaderScrolling] (ISC_Analytics.js?isc_version=11.1p_2019-06-06.js:286)
        at _3.isc_ListGrid_bodyScrolled [as bodyScrolled] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:1767)
        at _3.isc_GridBody_scrollTo [as scrollTo] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:669)
        at _3.isc_GridRenderer__scrollToTargetRow [as $270] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:214)
        at _3.isc_GridRenderer_modifyContent [as modifyContent] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:598)
        at _3.isc_Canvas__updateHTML [as $ra] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:2623)
        at _3.isc_Canvas_redraw [as redraw] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:2614)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:295)
        at _3.isc_GridRenderer_redraw [as redraw] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:598)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:295)
        at _3.isc_GridBody_redraw [as redraw] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:695)
        at _3.isc_GridRenderer_redrawOnScroll [as redrawOnScroll] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:219)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:295)
        at _3.isc_c_Class_Super [as Super] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:287)
        at _3.isc_GridBody_redrawOnScroll [as redrawOnScroll] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:705)
        at _3.isc_CubeGrid_syncHeaderScrolling [as syncHeaderScrolling] (ISC_Analytics.js?isc_version=11.1p_2019-06-06.js:286)
        at _3.isc_ListGrid_bodyScrolled [as bodyScrolled] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:1767)
        at _3.isc_GridBody_scrollTo [as scrollTo] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:669)
        at _3.isc_GridRenderer__scrollToTargetRow [as $270] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:214)
        at _3.isc_GridRenderer_modifyContent [as modifyContent] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:598)
        at _3.isc_Canvas__updateHTML [as $ra] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:2623)
        at _3.isc_Canvas_redraw [as redraw] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:2614)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:295)
        at _3.isc_GridRenderer_redraw [as redraw] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:598)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:295)
        at _3.isc_GridBody_redraw [as redraw] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:695)
        at _3.isc_GridRenderer_redrawOnScroll [as redrawOnScroll] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:219)
        at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:295)
        at _3.isc_c_Class_Super [as Super] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:287)
        at _3.isc_GridBody_redrawOnScroll [as redrawOnScroll] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:705)
        at _3.isc_CubeGrid_syncHeaderScrolling [as syncHeaderScrolling] (ISC_Analytics.js?isc_version=11.1p_2019-06-06.js:286)
        at _3.isc_ListGrid_bodyScrolled [as bodyScrolled] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:1767)
        at _3.isc_GridBody_scrollTo [as scrollTo] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:669)
        at _3.isc_GridRenderer__scrollToTargetRow [as $270] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:214)
        at _3.isc_GridRenderer_modifyContent [as modifyContent] (ISC_Grids.js?isc_version=11.1p_2019-06-06.js:598)
        at _3.isc_Canvas__updateHTML [as $ra] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:2623)
        at _3.isc_Canvas_redraw [as redraw] (ISC_Core.js?isc_version=11.1p_2019-06-06.js:2614)

    If I set
    Code:
    advancedCube.setShowAllRecords(true);
    then error will disappear but scroll is hang on in the middle of the CubeGrid data.

    Into Server Log I see some data selects when scroll is going down, but into SQL everything is OK. it looks very normal. :

    Code:
    SELECT
            t.id, t.step_id, t.address_or_box_id, t.value
      FROM ccare.building_install_data t
     WHERE (((LOWER(address_or_box_id) =
           '{8e16be80-babd-4cec-9d9a-ac078934ff10}') OR
           (LOWER(address_or_box_id) =
           '{16cc4262-547e-4b83-8cce-1f6807e78789}') OR
           (LOWER(address_or_box_id) =
           '{9b245387-bec8-4b02-8779-a377a8cf59ab}') OR
           (LOWER(address_or_box_id) =
           '{92835985-0207-40d4-8802-a90ee50df1d0}') OR
           (LOWER(address_or_box_id) =
           '{2a82a376-869a-4cf2-be84-c4d4101cc378}') OR
           (LOWER(address_or_box_id) =
           '{9b59bca9-3fe8-42b2-9282-fe2ed2049cea}') OR
           (LOWER(address_or_box_id) =
           '{286cdf51-05a7-40fd-9c86-b947f2b75343}') OR
           (LOWER(address_or_box_id) =
           '{1494f2e4-1d4e-40d9-8c27-af95889482de}') OR
           (LOWER(address_or_box_id) =
           '{2f0de698-ecf0-4c56-9953-e816146bcf23}') OR
           (LOWER(address_or_box_id) =
           '{7c412073-6305-4f0b-a259-67160ae1a1a3}') OR
           (LOWER(address_or_box_id) =
           '{22ef4914-82a6-455b-b6e3-63945d6b3424}') OR
           (LOWER(address_or_box_id) =
           '{f4e4a2a9-c60a-4322-5a48-4352a8d25b06}') OR
           (LOWER(address_or_box_id) =
           '{704015ff-b8f3-458c-e053-a0c809c03a37}')) AND
           ((step_id = 1) OR (step_id = 2) OR (step_id = 3) OR (step_id = 4) OR
           (step_id = 5) OR (step_id = 6) OR (step_id = 7) OR (step_id = 8) OR
           (step_id = 9) OR (step_id = 10) OR (step_id = 11) OR
           (step_id = 12) OR (step_id = 13) OR (step_id = 14) OR
           (step_id = 15) OR (step_id = 16) OR (step_id = 17) OR
           (step_id = 18) OR (step_id = 19) OR (step_id = 20) OR
           (step_id = 21) OR (step_id = 22) OR (step_id = 23) OR
           (step_id = 24) OR (step_id = 25) OR (step_id = 26)))
    If I remove CubeGrid table datasource and leave only facets (Then scroll appear in the end of the rows header) then scroll do not have any problem.


    Into data Table I have only 1 record :
    ID STEP_ID ADDRESS_OR_BOX_ID VALUE
    1 1 {D9A7E76D-F118-405C-B6A9-729A8D7815F4} 1


    Both Screens (Good & Bad) versions are attached to the post.


    I do not have any idea what is problem here :(

    Any idea will be appreciated ...

    Thanks In advance,
    Best Regards,
    Paata.

    Attached Files

    #2
    We have a developer taking a look at this issue.

    One question which may speed this analysis up: You mention that you're seeing this issue on the 6.1p build dated 2019-06-06. Have you been able to use the application code with earlier SmartGWT builds (in which case the upgrade itself caused the regression), or is this a bug encountered with new development.
    If you have seen this use case working in the past, can you let us know what the last "good" build you used was?

    Thanks and Regards
    Isomorphic Software

    Comment


      #3
      Originally posted by Isomorphic View Post
      We have a developer taking a look at this issue.

      One question which may speed this analysis up: You mention that you're seeing this issue on the 6.1p build dated 2019-06-06. Have you been able to use the application code with earlier SmartGWT builds (in which case the upgrade itself caused the regression), or is this a bug encountered with new development.
      If you have seen this use case working in the past, can you let us know what the last "good" build you used was?

      Thanks and Regards
      Isomorphic Software

      Hello ,

      Thank you very much for your reply.

      We had previous build of 6.1p (Dated 2017-07-05) and problem was the same and we thought maybe it was a bug and maybe fixed in the latest builds. We update the system to the latest build. Problem appears again.
      After a week searching and comparing our code to the example which is into showcase, we found a problem :

      Code:
      advancedCube.setAlternateRecordStyles(true);
      advancedCube.setShowRecordComponents(true);
      advancedCube.setShowRecordComponentsByCell(true);

      That was a reason of the problem. After removing this properties everything works as expected. We are not going to use custom components into CubeGrid, so for us this problem is resolved.


      Thank you again for your attentions and support.
      And if it will not be a off topic, We have another question regarding CubeGrid. (As I said it is first time we are using SmartGWT Analytics Module).

      We want to implement somehow refresh of the Cubegid Data (I mean row Facet Values and the data of the grid).

      We did not found any example like that. Our example :

      Code:
      // list of new Values
      List<FacetValue> newFacetValues = new ArrayList<>();
      
      // iterate records which comes from DB
      for (Record addrAndBox : buildingsData) {
          String globalid = addrAndBox.getAttributeAsString("globalid");
          String treeTitle = addrAndBox.getAttributeAsString("treeTitle");
          String parent_id = addrAndBox.getAttributeAsString("parent_id");
      
          FacetValue addrAndBoxElement = new FacetValue(globalid, treeTitle, parent_id);
          newFacetValues.add(addrAndBoxElement);
      }
      advancedCube.getFacet("address_or_box_id").setValues(newFacetValues.toArray(new FacetValue[0]));
      
      
      // refresh grid.
      advancedCube.invalidateCache();
      advancedCube.fetchData();

      But it doesn't work. Row facet values are not refreshed.

      Thanks In Advance.

      Regards,
      Paata.

      Comment

      Working...
      X