I have the following problem, which I do not know how to solve. I want that when making the registration in a table I already propose in the view a following number. I managed to arm the query, but for some reason it does not refresh in the view. Maybe someone can tell me what is the problem I'm having:
<p:outputLabel for="txtCuenta" value="Cuenta" />
<p:inputText id="txtCuenta" value="#{xxxController.cuenta.numero}" maxlength="05" size="05">
<p:ajax event="focus" update="txtCuenta" listener="#{xxxController.getUltimaCuenta}" />
</p:inputText>
<p:message for="txtCuenta"></p:message>
And in the xxxController I have the method getUltimaAccount, which works:
public short getUltimaCuenta(){
short numero=0;
numero=cuentaEJB.ultimo();
numero++;
return numero;
}
How do I get the value returned by the getUltimaCuenta
method to appear
in the inputText txtCuenta and store clear?