Announcement

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

    Bug in TextItem with keypressFilter

    Hi there
    I have a textItem which seems to have a bug using keyPressFilter. This bug occurs in all browser with the latest build (SmartClient_v101p_2016-02-03_Pro).

    1. Type "123"
    2. Press Enter (submit-function is called)
    3. Correct value is printed in the console
    4. Remove all charactes in the textItem
    5. Press Enter (submit-function is called)
    6. Wrong value is printed in the console

    Click image for larger version

Name:	Animation 37.gif
Views:	78
Size:	103.4 KB
ID:	234618

    If I'm leaving the field (blur) before between step 4 and 5 the field dies respond with the correct value.
    Click image for larger version

Name:	Animation 38.gif
Views:	56
Size:	106.6 KB
ID:	234619

    Maybe this case should be added to the automated test-cases. It doesn't seem to be a special use case, instead it is a very normal usage of the Form and the TextItem.

    Code for reproduction
    Code:
    isc.VLayout.create({
        "ID" : "theRootLayout",
        "hideUsingDisplayNone" : false,
        "leaveScrollbarGap" : false,
        "members" :
        [
            isc.DynamicForm.create({
                "ID" : "travelSearchForm_11",
                "submit" : function () {
                    console.log("enter pressed");
                    console.log(theField.getValue());
                },
                "width" : "100%",
                "autoDraw" : false,
                "padding" : 4,
                "hideUsingDisplayNone" : false,
                "numCols" : 5,
                "autoFocus" : true,
                "selectOnFocus" : true,
                "itemHoverDelay" : 1200,
                "saveOnEnter" : true,
                "readOnlyDisplay" : "static",
                "fields" :
                [{
                        "ID" : "theField",
                        "name" : "theField",
                        "title" : "Nr.",
                        "type" : "text",
                        "iconWidth" : 16,
                        "iconHeight" : 16,
                        "readOnlyDisplay" : "static",
                        "keyPressFilter" : "[0-9-]"
                    }
                ],
                "values" : {
                    "theField" : []
                }
            })
        ]
    })
    Regards

    #2
    Is there any news about this bug?
    Are you working on a fix? Was this post overseen?
    Do you need any additional information?

    Comment


      #3
      Don't worry, this is queued to be looked at. As a quick note, two problems with your code which might be related to this issue:

      1. you've initialized a type:"text" field with an empty Array

      2. you've set saveOnEnter and you are causing submit() to be called, but nothing is ultimately saved - the submit basically goes nowhere. It's likely this issue, if real, is normally prevented by some aspect of the normal saving process (which is why it's never been reported before).

      Comment


        #4
        Thanks,
        I've written again, because I've read nothing within the response time of three days.

        to 1: Thanks for the hint, i've corrected this in my example, but the isse persists.

        to 2: Yes, I have cut out everything, which is not needed for reproduction. In our real-environment, we are using a server-request in the submit event. The Textitem is used to search for specific IDs and get the result displayed in a listgrid below. Our customers are used to enter muliple ids one after another to get a fast overview over their tasks. Therefore they are using the enter key. With an empty field, they get an result in the listgrid without filtering for a specific id. Which is now not possible for the user, because the getValue() event which we are calling for the server-request does return wrong values.
        I have checked an older version and the bug is also persistent in "v10.0p_2015-11-26/Pro Deployment".

        btw: Issue is still reproducable in the latest downloadable version SmartClient_v101p_2016-02-06_Pro.

        Comment


          #5
          We've made a change which should address this issue in both the 10.1 and 11.0 branches. Please try the next nightly build, dated Feb 9 or above

          Regards
          Isomorphic Software

          Comment


            #6
            fix confirmed, thanks

            Comment

            Working...
            X