I am currently utilizing PrimeFaces and have a p:inputText field that requires updating certain components on the view based on the most recent keystroke within that p:inputText. Below is the code snippet:
<p:inputText value="#{customerLController.surnameFilterConstraint}"
id="surnamefilterfield">
<p:ajax event="keyup"
update=":custForm:custDataTable"
listener="#{customerLController.focusSurname}"
oncomplete="primeFacesId('surnamefilterfield')"/>
</p:inputText>
The issue here is that the code triggers Ajax even with arrow key strokes (which I want to avoid due to the expensive update). Ideally, I would prefer an alternative version of p:ajax event="change" with a condition to trigger change events on keystrokes rather than when the user presses Enter key (the current behavior).
If the p:ajax component does not provide a way to filter out specific keyup events, then it seems like the only (?) solution would be to execute JavaScript on the client side and handle the Ajax call in JavaScript. However, this would mean sacrificing the convenience of using the PrimeFaces p:ajax component, right?