Wicket
  1. Wicket
  2. WICKET-538

AjaxEventBehavior and associated components should feature Hot Key integration

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Later
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Java 2.6.20-15-generic, Java 6

      Description

      The idea of hot keys was actually born of the desire to trap keyhits on a top level basis (body.onKeyDown) to ensure that focus issues would not interfere with appropriate default processing. Basically, if one is working with a ModalWindow, both <CR> and <ESC> should invoke the behavior established by decades of UI history. In order to achieve this, I've constructed a javascript map, which associates keycodes generated through keydown events with Ajax calls. Initially, the focus was just for forms and ModalWindows. But I soon discovered that the functionality could be extended to general hotkeys, where specific keys could be tied to ajax behaviors (swapping panels, invoking submit behavior, etc). The benefit to the approach of having body.onKeyDown dispatch key events to a map is that there is a 1:n mapping of behaviors. Also, it removes the necessity of having to assign handlers to each component within a form or page, which is a rather heavy handed exercise. The complete solution would require modifications to AjaxEventBehavior, as well as some a few of the Ajax based components with the intent of establishing a corresponding keycode to trigger the event from the keyboard. I realize that this is a rather special case, bu it is still one that both solves pressing issues with the current implementation, as well as providing hot keys, which should be of value to the greater user community.

      I have completed most of the changes and would be more than happy to offer my code up for review.

        Activity

        Julian Klappenbach created issue -
        Hide
        Alastair Maw added a comment -

        This sounds very interesting, not least for solving multiply-mapped events, which are currently an issue. By all means attach a patch. We're not likely to look at this before 1.3.0 goes out, but we're certainly interested for 1.4.0. I'd recommend you kick off a discussion on the mailing list once 1.3.0 is out.

        Show
        Alastair Maw added a comment - This sounds very interesting, not least for solving multiply-mapped events, which are currently an issue. By all means attach a patch. We're not likely to look at this before 1.3.0 goes out, but we're certainly interested for 1.4.0. I'd recommend you kick off a discussion on the mailing list once 1.3.0 is out.
        Alastair Maw made changes -
        Field Original Value New Value
        Fix Version/s 1.4.0-alpha [ 12312523 ]
        Frank Bille Jensen made changes -
        Fix Version/s 1.4-M2 [ 12312911 ]
        Fix Version/s 1.4-M1 [ 12312523 ]
        Frank Bille Jensen made changes -
        Fix Version/s 1.4-M3 [ 12312912 ]
        Fix Version/s 1.4-M2 [ 12312911 ]
        Hide
        Martijn Dashorst added a comment -

        Moved to next milestone release.

        Show
        Martijn Dashorst added a comment - Moved to next milestone release.
        Martijn Dashorst made changes -
        Fix Version/s 1.4-M3 [ 12312912 ]
        Fix Version/s 1.4-M4 [ 12313295 ]
        Hide
        Timo Rantalaiho added a comment -

        This is a new feature so belongs to 1.5, right?

        Julian, please attach your code as a patch! At least when trunk is 1.5 It seems very interesting.

        Show
        Timo Rantalaiho added a comment - This is a new feature so belongs to 1.5, right? Julian, please attach your code as a patch! At least when trunk is 1.5 It seems very interesting.
        Timo Rantalaiho made changes -
        Fix Version/s 1.4-M4 [ 12313295 ]
        Fix Version/s 1.5-M1 [ 12313078 ]
        Igor Vaynberg made changes -
        Fix Version/s 1.5-M2 [ 12315237 ]
        Fix Version/s 1.5-M1 [ 12313078 ]
        Hide
        Julian Klappenbach added a comment -

        Timo, when I originally concieved of the enhancement, I was working on
        the 1.3 code base. Considerable changes have occurred in the
        interim. So, I would have to create an entirely new body of code to
        implement the change request. If this is truly desired, I would be
        happy provide the code, but it's going to take a bit before it's
        ready.

        Show
        Julian Klappenbach added a comment - Timo, when I originally concieved of the enhancement, I was working on the 1.3 code base. Considerable changes have occurred in the interim. So, I would have to create an entirely new body of code to implement the change request. If this is truly desired, I would be happy provide the code, but it's going to take a bit before it's ready.
        Igor Vaynberg made changes -
        Fix Version/s 1.5-M3 [ 12315329 ]
        Fix Version/s 1.5-M2 [ 12315237 ]
        Jeremy Thomerson made changes -
        Fix Version/s 1.5-M4 [ 12315483 ]
        Fix Version/s 1.5-M3 [ 12315329 ]
        Martin Grigorov made changes -
        Fix Version/s 1.5-M4 [ 12315483 ]
        Hide
        Martin Grigorov added a comment -

        Hi Julian,

        Patches are always welcome.
        We currently work on improving Wicket Ajax code for Wicket.next. I'll be glad to see some code for this idea. Even just a prototype.

        Show
        Martin Grigorov added a comment - Hi Julian, Patches are always welcome. We currently work on improving Wicket Ajax code for Wicket.next. I'll be glad to see some code for this idea. Even just a prototype.
        Hide
        Martin Grigorov added a comment -

        No activity here since a long time. Closing the ticket.

        Show
        Martin Grigorov added a comment - No activity here since a long time. Closing the ticket.
        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Later [ 7 ]
        Hide
        Patrick Davids added a comment -

        Hi all,
        I have a similar issue...

        We also support hotkeys to feature a lock screen in our UI by using Strg + l.

        I would like to vote for this.

        kind regards
        Patrick

        Show
        Patrick Davids added a comment - Hi all, I have a similar issue... We also support hotkeys to feature a lock screen in our UI by using Strg + l. I would like to vote for this. kind regards Patrick
        Hide
        Martin Grigorov added a comment -
        Show
        Martin Grigorov added a comment - Please take a look at https://github.com/martin-g/wicket-mousetrap
        Hide
        Patrick Davids added a comment -

        I will... thanx!

        Show
        Patrick Davids added a comment - I will... thanx!
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1983d 11h 38m 1 Martin Grigorov 09/Oct/12 12:46

          People

          • Assignee:
            Unassigned
            Reporter:
            Julian Klappenbach
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development