JDK-8126284 : (ctl + a) menu item onAction not invoked when ListView or TreeView is focused
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 7u6
  • Priority: P3
  • Status: Resolved
  • Resolution: Not an Issue
  • Submitted: 2012-06-22
  • Updated: 2015-06-17
  • Resolved: 2012-07-03
Related Reports
Blocks :  
Blocks :  
Blocks :  
Description
Use simple test case attached.
It defines a menu bar with menu item "Select All" and ctl + A accelerator,
and a simple scene graph containing a button, a ListView and a TreeView.
When the button is focused, typing (ctl + a) makes the onAction method invoked.
When the ListView or TreeView is focused, the onAction is no more invoked.

Note that we get the issue only when we do not use the system menu bar.
When using the system menu bar (mac os), the onAction method is invoked whatever node is focused as expected.
Comments
Closing as 'not an issue' as this is expected behaviour for mnemonics.
03-07-2012

Both ListView and TreeView seem to be working as expected here, as they both use Ctrl+A to SelectAll. The mnemonics code is only called for unconsumed key strokes. You should raise a separate jira for the different behaviour for menubars on mac.
29-06-2012

This is a mnemonic issue, because the ctrl-A keystroke is being consumed by ListView/TreeView internally, before it ever propagates to the menubar items. This is by-design - ctrl-A is used to select all, and it would be wrong for these controls to select all, and then let the keystroke continue to propagate up the scenegraph. Not much can be done for 2.2, but maybe this can be looked into for Lombard.
28-06-2012