Announcement

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

    NaN appears on invalid filter value

    There is an inconsistency in the FilterBuilder when entering spaces vs characters in the FIlterBuilder. THis is a very minor UI issue, nonetheless I report all of them as a result of our QA effort.

    REPRO steps
    =============
    1. Load the test case
    2. Click Filter button
    3. Create filter Inspector ID contains " " (spaces)
    4. Click Add
    5. Observe that the validation error icon appears and NaN displays in the value text field
    6. Reload the page
    7. Repeat steps using filter "ABCD"
    8. Observe that the validation error icon appears bu the original text is retained.


    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/skins/EnterpriseBlue/load_skin.js"></script>
         
            <script type="text/javascript" >
                var isomorphicDir="http://localhost:8080/isomorphic/";
                
                // set this to the correct JIRA ticket
                var JIRA_TICKET = "SNQA-1146";
                
                // 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"},
                        {name:"observations", title:"# Observations"},
                        {name:"region", type:"text", title:"Region/Country"},
                        {name:"lastInspectionDate", type:"date", title:"Last Inspection"}
                    ],
                    cacheData:data,
                    clientOnly: true
                });
                
                // once page loads set some diagnostic information, DO NOT CHANGE
                isc.Page.setEvent("load", function() {
                    document.title = JIRA_TICKET + "   (SmartClient version " + isc.versionNumber + ")";
                    var html = [];
                    html.push("Jira: " + JIRA_TICKET);
                    html.push("SmartClient: " + isc.versionNumber);
                    html.push("Browser: " + navigator.appCodeName + " " + navigator.appName + " " + navigator.appVersion);
                    diagLabel.setContents( html.join("<br>"));
                });
    
            
            </script>
    
        </head>
        
        <body>
            <script>
            
                // ===== DO NOT REMOVE =====
                var diagLabel = isc.Label.create({
                            ID: "diagInfo",
                            width: "100%",
                            styleName: "diagInfo",
                            autoFit: true
                        });
                // ===== DO NOT REMOVE =====
                            
                // 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,
                    canGroupBy : true,
                    canReorderFields : true,
                    showGroupSummary : true,
                    groupByMaxRecords : 5,
                    useAdvancedFieldPicker: true,
                    advancedFieldPickerThreshold: 5,
                    autoDraw: false,
                    badFormulaResultValue: "NA"
                });    
                
                var filter = isc.FilterBuilder.create({
                        dataSource : ds,
                        topOperatorAppearance : "radio",
                        allowEmpty : true,
                        height : 10
                });
    
                var filterDialog = isc.Window.create({
                    width : 600,
                    height : 350,
                    title : "Filter Grid",
                    canDragReposition : true,
                    canDragResize : true,
                    padding : 10,
                    autoCenter : true,
                    autoDraw : false,
                    items : [     
                        filter, 
                        isc.LayoutSpacer.create({
                            height : 10
                        }), 
                        isc.HLayout.create({
                            membersMargin : 25,
                            defaultLayoutAlign : "center",
                            align : "center",
                            width : "100%",
                            height : 10,
                            members : [     
                                isc.IButton.create({
                                        title : "Filter",
                                        click : function() {
                                            grid.filterData(filter.getCriteria());
                                        }
                                }), 
                                isc.IButton.create({
                                    title : "Clear Filter",
                                    click : function() {
                                        filter.clearCriteria();
                                        grid.filterData(filter.getCriteria());
                                    }
                                }) 
                            ]
                        }) 
                    ]
                });
        
                // the main page layout - place all other components afetr diagLabel
                var layout = isc.VLayout.create({
                    width:"100%",
                    membersMargin: 20,
                    members: [
                        // ===== DO NOT REMOVE diagLabel
                        diagLabel,
                        // ===== place anty components here
                        grid,
                        isc.IButton.create({
                                title : "Filter",
                                click : function() {
                                    filterDialog.show();
                                }
                        })
                    ]
                });
                
                    
            </script>
    
        </body>
    
    </html>

    #2
    This is assigned to be looked at shortly - we'll update here when we have more information.

    Comment


      #3
      Hi Isomorphic,

      this bug in the showcase (not important for me) is perhaps in the same or a related area.

      Best regards
      Blama

      Comment


        #4
        Blama - that's a separate issue - and it should already have been addressed - we'll see where that one is up to.

        @jwbst21 - we're actually not seeing this - what we see is that if you just enter spaces, as per your instructions, then no validation icon appears, and the value (a series of spaces) is indeed retained.

        Can you confirm your SC version and build-date, browser and version?

        Comment


          #5
          I am seeing it with v10.1p_2016-02-25/PowerEdition. The trick to reproducing the issue is step #4, you need to click the add icon in order to remove focus from the text field with the spaces.

          Browser: Mozilla Netscape 5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36
          Last edited by jwbst21; 29 Feb 2016, 10:26.

          Comment


            #6
            Bumping this post to see if there was any update.

            Comment


              #7
              It's being looked into along with another similar issue - we'll update within a day or so.

              Comment


                #8
                We still don't see any validation error-icons being displayed for an effectively blank value (" ") - in fact, the framework code for the isInteger validator had a bug, where it was accepting such empty string values as valid Integers which, of course, they aren't. So it's unclear how you could be getting an error-icon for a field which is passing validation....

                Possibly, your issue was already fixed by the fix for a similar bug reported this week by one of your associates.

                Anyway - we've fixed that bug and now, when we run your test-case, we see that:

                1) entering spaces into this (integer) field shows the validation error-icon
                2) removing the spaces, or adding a numeric digit, hides the error-icon again
                3) entering an alpha value shows the error-icon
                4) removing non-numerics hides the error-icon again

                Please retest with a build dated March 6 or later.

                Comment


                  #9
                  Verified that this has been fixed. Thanks.

                  Comment


                    #10
                    I am reopening this issue. This has been fixed for integer fields, but float fields still have the issue.

                    1. Load the test case
                    2. Click Filter button
                    3. Create filter Index ID greater than " " (spaces)
                    4. Click Add (to remove focus)
                    5. Observe that the validation error icon does not appear and NaN displays in the value text field

                    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/skins/EnterpriseBlue/load_skin.js"></script>
                        
                            <script type="text/javascript" >
                                var isomorphicDir="http://localhost:8080/isomorphic/";
                                
                                // set this to the correct JIRA ticket
                                var JIRA_TICKET = "SNQA-1146";
                                
                                // 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"},
                                        {name:"region", type:"text", title:"Region/Country"},
                                        {name:"index", type:"float", title:"Index"}
                                    ],
                                    cacheData:data,
                                    clientOnly: true
                                });
                                
                                // once page loads set some diagnostic information, DO NOT CHANGE
                                isc.Page.setEvent("load", function() {
                                    document.title = JIRA_TICKET + "   (SmartClient version " + isc.versionNumber + ")";
                                    var html = [];
                                    html.push("Jira: " + JIRA_TICKET);
                                    html.push("SmartClient: " + isc.versionNumber);
                                    html.push("Browser: " + navigator.appCodeName + " " + navigator.appName + " " + navigator.appVersion);
                                    diagLabel.setContents( html.join("<br>"));
                                });
                    
                            
                            </script>
                    
                        </head>
                        
                        <body>
                            <script>
                            
                                // ===== DO NOT REMOVE =====
                                var diagLabel = isc.Label.create({
                                            ID: "diagInfo",
                                            width: "100%",
                                            styleName: "diagInfo",
                                            autoFit: true
                                        });
                                // ===== DO NOT REMOVE =====
                                            
                                // 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,
                                    canGroupBy : true,
                                    canReorderFields : true,
                                    showGroupSummary : true,
                                    groupByMaxRecords : 5,
                                    useAdvancedFieldPicker: true,
                                    advancedFieldPickerThreshold: 5,
                                    autoDraw: false,
                                    badFormulaResultValue: "NA"
                                });    
                                
                                var filter = isc.FilterBuilder.create({
                                        dataSource : ds,
                                        topOperatorAppearance : "radio",
                                        allowEmpty : true,
                                        height : 10
                                });
                    
                                var filterDialog = isc.Window.create({
                                    width : 600,
                                    height : 350,
                                    title : "Filter Grid",
                                    canDragReposition : true,
                                    canDragResize : true,
                                    padding : 10,
                                    autoCenter : true,
                                    autoDraw : false,
                                    items : [     
                                        filter,
                                        isc.LayoutSpacer.create({
                                            height : 10
                                        }),
                                        isc.HLayout.create({
                                            membersMargin : 25,
                                            defaultLayoutAlign : "center",
                                            align : "center",
                                            width : "100%",
                                            height : 10,
                                            members : [     
                                                isc.IButton.create({
                                                        title : "Filter",
                                                        click : function() {
                                                            grid.filterData(filter.getCriteria());
                                                        }
                                                }),
                                                isc.IButton.create({
                                                    title : "Clear Filter",
                                                    click : function() {
                                                        filter.clearCriteria();
                                                        grid.filterData(filter.getCriteria());
                                                    }
                                                })
                                            ]
                                        })
                                    ]
                                });
                        
                                // the main page layout - place all other components afetr diagLabel
                                var layout = isc.VLayout.create({
                                    width:"100%",
                                    membersMargin: 20,
                                    members: [
                                        // ===== DO NOT REMOVE diagLabel
                                        diagLabel,
                                        // ===== place anty components here
                                        grid,
                                        isc.IButton.create({
                                                title : "Filter",
                                                click : function() {
                                                    filterDialog.show();
                                                }
                                        })
                                    ]
                                });
                                
                                    
                            </script>
                    
                        </body>
                    
                    </html>

                    Comment


                      #11
                      Ok, we fixed that one too - you can try it out tomorrow.

                      However - we *still* don't see the text "NaN" being written out in the field.

                      Can you clarify your browser, OS amd locale.

                      Comment


                        #12
                        Ill check again, but the trick is to remove focus by clicking the green Add icon.

                        Comment


                          #13
                          Chrome 48, Windows 7, SmartClient_v101p_2016-03-14_PowerEdition

                          REPRO steps
                          =============
                          1. Load the test case
                          2. Click Filter button
                          3. Create filter for Index greater than " " (spaces) ---> this is the float field
                          4. Click Green Add button to remove focus
                          5. Observe that the validation error icon does not appear and NaN displays in the value text field
                          6. Create filter for Inspector ID contains " " (spaces) ---> this is the integer field
                          7. Click Green Add button to remove focus
                          8. Observe Inspector ID field shows validation error icon but does not show NaN

                          Click image for larger version

Name:	3-15-2016 10-12-26 AM.png
Views:	65
Size:	12.9 KB
ID:	235845
                          Attached Files

                          Comment

                          Working...
                          X