I have some JSF forms with hot keys, for example, CTRL+ Swill save data.
The problem is that when you press a key combination and focus in the field <p:selectOneMenu>, the first element is selected, starting with S(in accordance with the example), and then the form is sent.
You can reproduce this behavior in showcase in the first field by pressing CTRL+ O. In Chrome, at least he will choose the first option, and then the Open Dialog browser.
I want this component to ignore the letter when a special key is pressed.
I tested this behavior against the SELECThtml element and the "combo box" from jQuery UI, but that just doesn't happen. The surface implementation of SelectOneMenu is a different wrapper for the input field.
I tried return falsein both the attributes onkeyupand onkeydownlisted in the PF User Guide. No results.
I also tried adding jQuery keyboard event listeners with preventDefault()and return false. Nothing.
Before delving into PrimeFaces code, I would like to know if there is a known workaround for this case.
source
share