I am using PrimeFaces and have a p:inputText field where I need to update some components on the view based on the latest keystroke inside that p:inputText. Here's the code:
<p:inputText value="#{customerLController.surnameFilterConstraint}"
id="surnamefilterfield">
<p:ajax event="keyup"
update=":custForm:custDataTable"
listener="#{customerLController.focusSurname}"
oncomplete="primeFacesId('surnamefilterfield')"/>
</p:inputText>
The thing is, the above code fires up Ajax even in the case of arrow keystrokes (which I would rather avoid given the costly update). Ideally I would like a different version of p:ajax event="change" with the qualification that change is pronounced on keystrokes and not when the user hits Enter (which is what happens now).
If the p:ajax component doesn't allow a way to filter out certain keyup events, then I gather that the only (?) alternative would be to call JavaScript on the client side and then implement the Ajax call in Javascript but then I would forsake the convenience of using the PrimeFaces p:ajax component, wouldn't I?