Hi,
I have context menu on a TreeGrid that uses Ctrl+N to create a new folder. If I select a node and press Ctrl+N my dialog appears on the application but a new browser window is also created.
I am testing on firefox 14.0.1.
I am assuming that I need to somehow cancel the keypress event in order to stop it bubbling up to the browser but I can't see how to do it.
I am using the following code:
I don't know if this is of any use but I get the following debug in the console when I enter 'Ctrl+N'
Can you tell me what I need to do to stop the new browser window appearing.
Thanks,
MikeA
SmartClient Version: SC_SNAPSHOT-2012-01-03_v8.2p/Pro Deployment (built 2012-01-03)
I have context menu on a TreeGrid that uses Ctrl+N to create a new folder. If I select a node and press Ctrl+N my dialog appears on the application but a new browser window is also created.
I am testing on firefox 14.0.1.
I am assuming that I need to somehow cancel the keypress event in order to stop it bubbling up to the browser but I can't see how to do it.
I am using the following code:
Code:
MenuItem addFolder = new MenuItem("Add Folder...", "cat/add_folder.png", "Ctrl+N");
KeyIdentifier key = new KeyIdentifier();
key.setKeyName("N");
key.setCtrlKey(true);
addFolder.setKeys(key);
addFolder.addClickHandler(new ClickHandler() {
public void onClick(MenuItemClickEvent event) {
...
}
});
Code:
17:29:31.847:KDN7:INFO:EventHandler:keyDown event with Canvas target: [TreeGridBody ID:PropertyFolderTree_body], native target: [DIVElement]{ID:isc_U}
17:29:31.849:KDN7:DEBUG:EventHandler:Event 'keyDown' bubbled to top
17:29:31.959:KDN8:INFO:EventHandler:keyPress event with Canvas target: [TreeGridBody ID:PropertyFolderTree_body], native target: [DIVElement]{ID:isc_U}
17:29:31.959:KDN8:DEBUG:EventHandler:keyPress not handled natively
17:29:31.960:KDN8:DEBUG:EventHandler:Event 'keyPress' bubbled to top
17:29:31.962:KDN8:INFO:EventHandler:keyPress event with Canvas target: [TreeGridBody ID:PropertyFolderTree_body], native target: [DIVElement]{ID:isc_U}
17:29:31.962:KDN8:DEBUG:EventHandler:Event 'keyDown' bubbled to top
17:29:31.964:KPR9:INFO:EventHandler:keyPress event with Canvas target: [TreeGridBody ID:PropertyFolderTree_body], native target: [DIVElement]{ID:isc_U}
17:29:31.964:KPR9:DEBUG:EventHandler:keyPress not handled natively
17:29:31.965:KPR9:DEBUG:EventHandler:Event 'keyPress' bubbled to top
17:29:32.486:KUP1:INFO:EventHandler:keyUp event with Canvas target: null, native target: [BODYElement]{nodeName:BODY}
17:29:32.500:KUP2:INFO:EventHandler:keyUp event with Canvas target: null, native target: [BODYElement]{nodeName:BODY}
Thanks,
MikeA
SmartClient Version: SC_SNAPSHOT-2012-01-03_v8.2p/Pro Deployment (built 2012-01-03)