Keyboard shortcuts on my JSF page

I was wondering if there is a way to make a simple shortcut on my JSF page

each page has several buttons, and I would like the user to click something like alt + a to activate the "Add report to group" button

you simply put in.net in front of the letter that you want to use as a keyboard shortcut, is there such an option in JSF (except for writing javascript code that I found on the Internet).

+4
source share
1 answer

Use the accesskey attribute provided by HTML, which also appears in <h:commandButton> and <h:commandLink> .

 <h:commandButton value="Add" accesskey="a" action="#{bean.add}" /> 

Then this button can be called using Alt + A or Shift + Alt + A , depending on the browser you are using.

+7
source

Source: https://habr.com/ru/post/1342294/


All Articles