<p:commandButton id="cmdCancel" value="#{label.cancel}" action="cancel"/>
<p:hotkey bind="Alt+C" action="cancel" />
Hi ,
I have one button cancel and i binded it to short cut key “Alt+C” (refer above code) in prime faces.
And when i use press short cut key “Alt+C”, it perform the cancel action and
but it also open the browser favorites menu on pressing the “Alt+C”.
How can i stop this opening browser operation?Please suggest me any solution,…….
I guess that you simply can not override some of the browser’s hardwired default hotkeys.
Think of pressing Alt+F4 to close the browser window etc.
Even the normal HTML hotkey attribute is not guaranteed to work if the browser already does something else when pressing the hotkey combination.
My answer is thus; Do not rely on hotkeys in a website to work at all.