i want to implement a validation for a username. The 'normal' way to do it is something like that:
<h:outputText for="username" value="Username:" />
<p:inputText id="username" value="#{registerService.username}" >
<f:validator binding="#{usernameValidator}" />
</p:inputText>
<p:message for="username" />
<p:commandButton type="submit" value="Submit" action="#{registerService.addUser}" ajax="false" update="panel" validateClient="true" />
But what i now want to do is to validate the username everytime the user presses a key in the username inputText without pressing the commandButton.
So each character should trigger the validation and should update the messages field for username to show the user instantly if the username is already present in database or not.
How can i do that?