Here is my xHTML code:
<div id="list">
<p:outputLabel styleClass="heading" value="#{msg['content.search.title']}" />
<p:outputLabel value="#{msg['content.search.bic']}" />
<p:inputText styleClass="prefix" value="#{Controller.prefix}" maxlength="4" onkeyup="return this.value.length >= 4">
<p:ajax event="keyup" listener="#{Controller.check}"></p:ajax>
</p:inputText>
<p:inputText id="countryCode" widgetVar="countryCode" styleClass="countryCode" value="#{Controller.CountryCode}" maxlength="2">
<\div>
My java backing bean function looks like this:
public String check()
{
RequestContext.getCurrentInstance().execute("list:countryCode.focus();");
return "";
}
What I want is that when I enter 4 characters in prefix the focus should automatically go to the next InputText field which is the CountryCode. I don't receive any errors and after entering 4 characters my backing bean method is called and run successfully however the focus on the gui does not change.
I suspect that maybe my code in the backing bean does not do what it is supposed to, maybe it does not find the CountryCode field.
The way this question is different than the ones tagged is that I cannot create a seperate in my project, hence no Jquery.