jquery - Fire f:ajax only on specific keys -


I call f: AJAX inside h: inputText For a backing bean method that performs a search based on input, with a delay:

  & lt; H: Input Text ... & gt; & Lt; F: ajax delay = "500" event = "keyup" listener = "# {cc.attrs.completeMethod}" event = "function (data) {mx.util.onComplete (data, mx.ezOverlay.handle)}" / & Gt; & Lt; / H: inputText>  

I no longer want to send requests for every key - especially arrow keys, which I use to navigate in a drop down list with the result .

I know how to find an jQuery event listener for input, how it is discovered that manually checked what key was used And to handle demo and call PrimeFaces RemoteCommand for the method

My question is whether there is any way to avoid sending AJAX requests for some key, e.g. SHIFT, CTRL and arrow keys; When using f: Ajax Or maybe there is a better way to handle delays (with the goal of sending every keystroke for backing beans -> not finding a database for each keystroke).

Comments