Keyboard Shortcuts in my JSF page
I was wondering if there is a way to make an easy keyboard shortcut in my JSF page
each page has several buttons and I would like to be able to have a user press something like alt+a to activate a button called 'Add Report to Group'
in .n开发者_开发知识库et you just put an & before the letter you want to be the shortcut key, is there an option like this in JSF (apart from writing some javascript code which is what I found on the web)
Use the HTML-provided accesskey
attribute which is also mapped in <h:commandButton>
and <h:commandLink>
.
<h:commandButton value="Add" accesskey="a" action="#{bean.add}" />
This button can then be invoked by Alt+A or Shift+Alt+A, depending on the browser used.
精彩评论