Announcement

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

    setSaveOnEnter() behavior

    Hi,

    I am having two problems with setSaveOnEnter().

    1) Some of my form items have picker icons. When the user navigates to the picker icon using the TAB key, they need to press ENTER to trigger the action associated with the it. However, this also submits the form :(

    2) I also have a custom item that displays a drop-down grid when activated. The user can press ENTER to select an item in the grid. This is done by adding a keyDownHandler to the grid. Inside this handler I call event.cancel() but it does not stop the event from bubbling up to the form :(

    Any hints?

    Best,
    Michał

    #2
    1. spacebar is normally the keyboard shortcut for activating a button

    2. can you show sample code where you are unable to cancel the Enter event?

    Comment


      #3
      Hi,

      1. For buttons, yes; but picker icons seem to behave differently. See the SmartGWT Showcase, sample called Various Controls, field called Color Picker.

      2. I will try, thanks.

      Michal

      Comment


        #4
        1. We've added space as an additional means to trigger these icons for 3.1d and 3.0p, should be in tomorrow's build. Thanks for pointing this out. For now, we're retaining the behavior that Enter triggers a save.

        Comment


          #5
          For 1.:
          The problem about a web-application is that you can not properly teach your users how to use it. Users just press Return or Enter. If they wanted to open a Popup from a Picker-Icon and besides also save the form data this remains a bug from the users perspective.

          The SubmitValuesEvent does not contain the required information to workaround this. The source is the DynamicForm and X/Y will not help. Also there is no way to get the currently focused element.
          Therefore the only workaround I can find is not to use this feature and add keyboard-listeners to all your form-items.

          Comment


            #6
            Sorry, we're not following this.

            To open an FormItemIcon without saving, users can now hit Space.

            To save they can hit Enter (if saveOnEnter is enabled).

            Hitting Enter while focused on a FormItemIcon will trigger both - but this is harmless (they can just dismiss the pop-up) and the user will learn this immediately.

            Comment

            Working...
            X