Announcement

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

    SpinnerItem problem with KeyPressFilter and ChangeHandler

    Hi Isomorphic,
    We have such use case : we need to disable and clear value from some text field if a user inputs some value in some another spinner item and otherwise - enable text field when value in the spinner is null or empty.
    We allow user to insert manually some value to the spinner item not using increase and decrease buttons, but we restrict him to insert manually only numbers, that's why we use setKeyPressFilter.
    Also we use addChangeHandler on spinnerItem to disable another text field.
    I reproduced the case on Enable & Disable showcase.I attached the changed java file.(I just added new fied Numbers which should disable/enable FullName item)
    FormEnableDisableSample.java
    So the problem happens when we input/clear (from keyboard) value into the Number then the FullName text field is not disabled/enabled. ChangeHandler from Numbers doesn't call at all.

    Also I want to notice if I just use increase and decrease buttons of spinner item (Numbers) I see disabling of FullName field.But if I try to clear value of Numbers (with backspace) then FullName is not getting enabled again, only if I click on it.
    I would like also to mention that if to replace SpinnerItem with just simple TextItem then the problem will be similar.But in this case the dependent field (FullName) is getting disabled, but after clearing value (from Numbers) FullName is not enabled again.
    We tested also that there is no such problem with TextItem if we don't use keyPressFilter at all.

    So it looks like it is common problem. Could you please check?
    We use 5.0p.2017-01-18/PowerEditionDeployment smart gwt version, FF browser version 26.0

    #2
    Hi Isomorphic,

    Do you have any news about this problem?

    Comment


      #3
      Sorry for the delay in getting to this - there was a missed email notification, which we are looking into.

      Have you tested this with any modern Firefox version? FF 26 is very old and wasn't an ESR. It's missing lots of security fixes.

      You report that the change handler isn't firing - we're not seeing this in any recent version. Is it possible your change handler is just crashing and you missed the error message? Are you seeing the change handler fire when you leave the field (you can set changeOnKeypress for more frequent notifications).

      Comment


        #4
        Hi Isomorphic,

        Do you mean that you run this showcase which I posted on modern FF version and this problem is not reproducible on your side?
        I think the problem is not in FF browser, because for me it also doesn't work in other browers like Chrome (56.0.2924.87 (64-bit)) and also in IE (version 11.0.9600.18537).
        Also I would like to mention that I don't see any error message for change handler.It is just not executed at all even when I leave the field.
        When I tried to setChangeOnKeypress(true), (according to java doc it is written it should be true by default), the disabling start working, but enabling again doesn't work.
        It means that when I input the value into the spinner item the FullName is disabling, but when I clear the value (by backspace) from spinneritem, FullName items is not enabled.The changeHandler does not fire, but it starts fire when I leave the spinner item.So now my test case is:
        1)Input 12 into spinnerItem - changeHandler called twice
        2)Clear 2 - changeHandler is called
        3)Clear 1 - changeHandler is not called, it is called when I leave spinnerItem.
        I I try just to insert 1- changeHandler is called, but after clear 1 it is again called only after leaving spinnerItem.
        On my opinion it is not expected behavior, it should be called immediately not only after leaving item.

        Comment


          #5
          We had not set up a perfect match to your versions (which, as we've covered before, really really needs to be updated to at least 5.1 - and it's been months now) but we weren't reproducing problems in recent versions.

          To clarify - you said removing the keyPressFilter allows a normal TextItem to behave without issues. Is this also true for you when you remove the keyPressFilter from the SpinnerItem?

          Comment


            #6
            Unfortunately right now we can not simply upgrade to 5.1 version. But after removing setKeyPressFilter on SpinnerItem and setting only setChangeOnKeyPressFilter(true) it suddenly starts to work as I expected.
            It means that other letters except number from keyboard is not possible to input into the SpinnerItem and disabling / enabling logic works perfectly.

            Comment

            Working...
            X