ICEfaces
  1. ICEfaces
  2. ICE-8812

ace:maskedEntry - Add a onKeypress client event

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: EE-3.2.0.GA, 3.3
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P1
    • Salesforce Case Reference:
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)

      Description

      Feature Request: A customer would like the ability to fire an ace:ajax listener for each key press, up, or down key stroke.
      1. screenshot-01.png
        307 kB
      2. screenshot-02.png
        100 kB
      3. screenshot-03.png
        268 kB
      4. screenshot-04.png
        257 kB

        Activity

        Hide
        yip.ng added a comment - - edited

        For some of the intricacies of the keypress event, read these:

        http://lists.webkit.org/pipermail/webkit-dev/2007-December/002992.html
        http://help.dottoro.com/ljlwfxum.php
        http://www.quirksmode.org/dom/events/keys.html
        http://msdn.microsoft.com/en-us/library/ie/ms536939%28v=vs.85%29.aspx
        https://developer.mozilla.org/en-US/docs/DOM/event.keyCode

        Will use jQuery keypress event and listener which hopefully are cross-browser enough.
        (The third-party Masked Input Plugin is already using the jQuery keypress event to do a lot of other things.)

        Show
        yip.ng added a comment - - edited For some of the intricacies of the keypress event, read these: http://lists.webkit.org/pipermail/webkit-dev/2007-December/002992.html http://help.dottoro.com/ljlwfxum.php http://www.quirksmode.org/dom/events/keys.html http://msdn.microsoft.com/en-us/library/ie/ms536939%28v=vs.85%29.aspx https://developer.mozilla.org/en-US/docs/DOM/event.keyCode Will use jQuery keypress event and listener which hopefully are cross-browser enough. (The third-party Masked Input Plugin is already using the jQuery keypress event to do a lot of other things.)
        Hide
        yip.ng added a comment - - edited

        KeyPressEvent added and worked smoothly when render="@none". See screenshot-01.png.

        However, when render="@this", both the value (first and only character input) and the focus just disappear on re-render. See video http://screencast.com/t/K1nt0nWdjVCl. Console shows that framework has applied updates and focus:

        [window] applied updates >>
        update["form:dobInput"]: <span id="form:dobInput"><input aria-lab....
        update["javax.faces.ViewState"]: 4118240290899047183:-3169996285773209031....
        eval: ice.applyFocus('form:dobInput_field');....

        Show
        yip.ng added a comment - - edited KeyPressEvent added and worked smoothly when render="@none". See screenshot-01.png. However, when render="@this", both the value (first and only character input) and the focus just disappear on re-render. See video http://screencast.com/t/K1nt0nWdjVCl . Console shows that framework has applied updates and focus: [window] applied updates >> update ["form:dobInput"] : <span id="form:dobInput"><input aria-lab.... update ["javax.faces.ViewState"] : 4118240290899047183:-3169996285773209031.... eval: ice.applyFocus('form:dobInput_field');....
        Hide
        yip.ng added a comment - - edited

        Seems when you tab out of an incomplete field the plugin would just blank out the field. See video http://screencast.com/t/WkQ5brrubo. But in this case the character is submitted before any tab and does get to the server. See screenshot-02. But in the re-render and subsequent re-init the plugin wipes it out again, probably seeing that it is as an incomplete entry again. Meanwhile the focus is also lost by the framework.

        Show
        yip.ng added a comment - - edited Seems when you tab out of an incomplete field the plugin would just blank out the field. See video http://screencast.com/t/WkQ5brrubo . But in this case the character is submitted before any tab and does get to the server. See screenshot-02. But in the re-render and subsequent re-init the plugin wipes it out again, probably seeing that it is as an incomplete entry again. Meanwhile the focus is also lost by the framework.
        Hide
        yip.ng added a comment -

        Suggestion from Ken:

        • make all input optional
        • assume no re-render or JS-like event-handling from server side
        • wrap value in event as well
        Show
        yip.ng added a comment - Suggestion from Ken: make all input optional assume no re-render or JS-like event-handling from server side wrap value in event as well
        Hide
        yip.ng added a comment -

        Done as suggested above. Found simpler way to get at char as translated by plugin. Therefore can pass char (instead of keycode) to event. See screenshot-03 and -04 for event details.

        Subversion: Committed revision 33046.

        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\event\KeyPressEvent.java#33046
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\maskedentry\MaskedEntry.java#33046
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\maskedentry\maskedentry.js#33046
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\maskedentry\MaskedEntryMeta.java#33046
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\maskedentry\readme.txt#33046

        Show
        yip.ng added a comment - Done as suggested above. Found simpler way to get at char as translated by plugin. Therefore can pass char (instead of keycode) to event. See screenshot-03 and -04 for event details. Subversion: Committed revision 33046. A: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\event\KeyPressEvent.java#33046 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\maskedentry\MaskedEntry.java#33046 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\maskedentry\maskedentry.js#33046 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\maskedentry\MaskedEntryMeta.java#33046 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\maskedentry\readme.txt#33046

          People

          • Assignee:
            yip.ng
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: