Announcement

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

    Page.registerKey prevent from bubbling

    Hi,

    I'm trying to build some keyboard shortcuts into my app with Page.registerKey(), but unfortunately ctrl+s is not working as I want.

    It does work, but it also displays the "save this page" dialog of the browser, which I don't need for my application.

    Is there any way I can prevent events from bubbling and just stop them after handling my KeyHandler? I have found a script on the net which appears to be capable of doing that, but I'm not sure if it's possible with SmartGWT.


    Thank you,
    Steven

    #2
    What version are you using? Although we recommend not trying to override something like ctrl-S as it's very likely this will surprise users, we've recently improved the ability to override other browser shortcuts. Try the latest nightly, and if it still doesn't work, please show your code.

    Comment


      #3
      SmartClient Version: v8.3p_2012-11-26/LGPL Development Only (built 2012-11-26)

      SmartClient Version: v8.3p_2012-11-26/LGPL Development Only (built 2012-11-26)

      FF 7 , Chrome ,

      I want to override Ctrl + A on my application, I used Page.registerKey to do that ,the handler worked fine, but unfortunately every time the whole page will be selected !, how can I prevent the default action ??

      Any help please,
      Code:
      KeyIdentifier clientLogKey = new KeyIdentifier();
      		clientLogKey.setCtrlKey(true);
      		clientLogKey.setKeyName("A"); //$NON-NLS-1$
      		Page.registerKey(clientLogKey, new KeyCallback() {
      			@Override
      			public void execute(String keyName) {
      
      	                       doSomeThing();	
      			}
      		});

      Comment

      Working...
      X