Announcement

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

    summaryUpdated not firing when updating summary field

    SmartClient_v101p_2016-02-18_PowerEdition

    REPRO steps
    ==========
    1. Load test case
    2. Create a formula field
    3. Observe "Formula Updated" in console
    4. Create summary field
    5. Observe that there is not a console entry "Sumamry Updated"

    We need this to fire as we do some post processing when summaries are created/updated.

    Code:
    <!DOCTYPE html>
    
    <html>
        <head>
    
            <title></title>
            
            <style>
                .diagInfo {
                    font-size: 14px;
                    font-weight: bold;
                    padding: 5px;
                }
            </style>
            
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Core.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Foundation.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Containers.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Grids.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Forms.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_DataBinding.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Drawing.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_PluginBridges.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Charts.js"></script>    
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Tools.js"></script>
            <script type="text/javascript" SRC="http://localhost:8080/isomorphic/skins/EnterpriseBlue/load_skin.js"></script>
        
            <script type="text/javascript" >
                var isomorphicDir="http://localhost:8080/isomorphic/";
                
                // set this to the correct JIRA ticket
                var jiraTicket = "SNT-12947";
                
                // test data
                var data = [
                    {inspectorID:12345, region:"Northeast", inspections:206, observations:913,lastInspectionDate:new Date(2012, 8, 13), index:52.6 },
                    {inspectorID:67890, region:"West", inspections:66, observations:2,lastInspectionDate:new Date(2013, 2,2), index:75.3 },
                    {inspectorID:54321, region:"Northeast", inspections:4, observations:67,lastInspectionDate:new Date(2013,2,3), index:75.3 },
                    {inspectorID:09876, region:"South", inspections:24, observations:0,lastInspectionDate:new Date(2012,8,31), index:52.6 }
                ];
                // datasource for the grid        
                isc.DataSource.create({
                    ID: "ds",
                    fields: [
                        {name:"inspectorID", title:"Inspector ID", type:"integer", showIf:"false" }, // hidden
                        {name:"inspections", type:"integer", title:"Number of Inspections Total"}
                    ],
                    cacheData:data,
                    clientOnly: true
                });
                
                // once page loads set some diagnostic information
                isc.Page.setEvent("load", function() {
                    document.title = jiraTicket + "   (SmartClient version " + isc.versionNumber + ")";
                    var html = [];
                    html.push("Jira: " + jiraTicket);
                    html.push("SmartClient: " + isc.versionNumber);
                    html.push("Browser: " + navigator.appCodeName + " " + navigator.appName + " " + navigator.appVersion);
                    diagLabel.setContents( html.join("<br>"));
                });
            </script>
    
        </head>
        
        <body>
            <script>
            
                // this laebl should not be removed, all test cases should have this
                var diagLabel = isc.Label.create({
                            ID: "diagInfo",
                            width: "100%",
                            styleName: "diagInfo",
                            autoFit: true
                        });
                
                
                
                // basic grid        
                var grid = isc.ListGrid.create({
                    dataSource: ds,
                    dataFetchMode : "local",
                    autoFetchData: true,
                    clientOnly: true,
                    position: "relative",
                    width : "100%",
                    align : "center",
                    autoFitData : "vertical",
                    autoFitMaxHeight : 400,
                    alternateRecordStyles : true,
                    canAddFormulaFields : true,
                    canAddSummaryFields : true,
                    autoDraw: false
                });    
                    
                // the main page layout - place all other components afetr diagLabel
                isc.VLayout.create({
                    width:"100%",
                    membersMargin: 20,
                    members: [
                        // this must remain here to output diagnostic information
                        diagLabel,
                        // add any other components here
                        grid
                    ]
                });
                
                grid.formulaUpdated = function(field, formula) {
                    console.log("Formula updated");
                }
                
                grid.summaryUpdated = function(field, summary) {
                    console.log("Summary updated");
                }
                    
            </script>
    
        </body>
    
    </html>

    #2
    Could you adjust your test case to get rid of the obvious usage errors (direct assignment to method slots). You may still reproduce the bug, but please don't post test cases like this as there are definite known situations where this will not work.

    Comment


      #3
      Updated test case, still has the bug:

      Code:
      <!DOCTYPE html>
      
      <html>
          <head>
      
              <title></title>
              
              <style>
                  .diagInfo {
                      font-size: 14px;
                      font-weight: bold;
                      padding: 5px;
                  }
              </style>
              
              <script type="text/javascript" SRC="http://localhost:8080/isomorphic//system/modules/ISC_Core.js"></script>
              <script type="text/javascript" SRC="http://localhost:8080/isomorphic//system/modules/ISC_Foundation.js"></script>
              <script type="text/javascript" SRC="http://localhost:8080/isomorphic//system/modules/ISC_Containers.js"></script>
              <script type="text/javascript" SRC="http://localhost:8080/isomorphic//system/modules/ISC_Grids.js"></script>
              <script type="text/javascript" SRC="http://localhost:8080/isomorphic//system/modules/ISC_Forms.js"></script>
              <script type="text/javascript" SRC="http://localhost:8080/isomorphic//system/modules/ISC_DataBinding.js"></script>
              <script type="text/javascript" SRC="http://localhost:8080/isomorphic//system/modules/ISC_Drawing.js"></script>
              <script type="text/javascript" SRC="http://localhost:8080/isomorphic//system/modules/ISC_PluginBridges.js"></script>
              <script type="text/javascript" SRC="http://localhost:8080/isomorphic//system/modules/ISC_Charts.js"></script>    
              <script type="text/javascript" SRC="http://localhost:8080/isomorphic//system/modules/ISC_Tools.js"></script>
              <script type="text/javascript" SRC="http://localhost:8080/isomorphic/skins/EnterpriseBlue/load_skin.js"></script>
          
              <script type="text/javascript" >
                  var isomorphicDir="http://localhost:8080/isomorphic/";
                  
                  // set this to the correct JIRA ticket
                  var jiraTicket = "SNT-12947";
                  
                  // test data
                  var data = [
                      {inspectorID:12345, region:"Northeast", inspections:206, observations:913,lastInspectionDate:new Date(2012, 8, 13), index:52.6 },
                      {inspectorID:67890, region:"West", inspections:66, observations:2,lastInspectionDate:new Date(2013, 2,2), index:75.3 },
                      {inspectorID:54321, region:"Northeast", inspections:4, observations:67,lastInspectionDate:new Date(2013,2,3), index:75.3 },
                      {inspectorID:09876, region:"South", inspections:24, observations:0,lastInspectionDate:new Date(2012,8,31), index:52.6 }
                  ];
                  // datasource for the grid        
                  isc.DataSource.create({
                      ID: "ds",
                      fields: [
                          {name:"inspectorID", title:"Inspector ID", type:"integer", showIf:"false" }, // hidden
                          {name:"inspections", type:"integer", title:"Number of Inspections Total"}
                      ],
                      cacheData:data,
                      clientOnly: true
                  });
                  
                  // once page loads set some diagnostic information
                  isc.Page.setEvent("load", function() {
                      document.title = jiraTicket + "   (SmartClient version " + isc.versionNumber + ")";
                      var html = [];
                      html.push("Jira: " + jiraTicket);
                      html.push("SmartClient: " + isc.versionNumber);
                      html.push("Browser: " + navigator.appCodeName + " " + navigator.appName + " " + navigator.appVersion);
                      diagLabel.setContents( html.join("<br>"));
                  });
              </script>
      
          </head>
          
          <body>
              <script>
              
                  // this laebl should not be removed, all test cases should have this
                  var diagLabel = isc.Label.create({
                              ID: "diagInfo",
                              width: "100%",
                              styleName: "diagInfo",
                              autoFit: true
                          });
                  
                  
                  
                  // basic grid        
                  var grid = isc.ListGrid.create({
                      dataSource: ds,
                      dataFetchMode : "local",
                      autoFetchData: true,
                      clientOnly: true,
                      position: "relative",
                      width : "100%",
                      align : "center",
                      autoFitData : "vertical",
                      autoFitMaxHeight : 400,
                      alternateRecordStyles : true,
                      canAddFormulaFields : true,
                      canAddSummaryFields : true,
                      autoDraw: false,
                      formulaUpdated: function(field, formula) {
                          console.log("Formula updated");
                      },
                      summaryUpdated: function(field, summary) {
                          console.log("Summary updated");
                      }
                  });    
                      
                  // the main page layout - place all other components afetr diagLabel
                  isc.VLayout.create({
                      width:"100%",
                      membersMargin: 20,
                      members: [
                          // this must remain here to output diagnostic information
                          diagLabel,
                          // add any other components here
                          grid
                      ]
                  });
                      
              </script>
      
          </body>
      
      </html>

      Comment


        #4
        Thanks for the test-case - this has been fixed in all versions for builds dated February 24 and later.

        Comment


          #5
          Thanks!

          Comment

          Working...
          X