I'm having a problem using ajax of the primefaces , also tried with ajax jsf . I have the following code snippet:
<h:panelGroup>
<p:inputText id="skuProduto" size="20" maxlength="20"
value="#{cadastroProdutoPapBean.produto.sku}"
validator="#{cadastroProdutoPapBean.validaProduto}">
<p:ajax event="keyup" execute="@this" update="mesSkuProduto, teste"/>
</p:inputText>
<p:message display="text" for="skuProduto" style="color:red"
id="mesSkuProduto" rendered="true" />
<h:outputText id="teste"value="Aqui o teste do que foi digitado: #{cadastroProdutoPapBean.produto.sku}" style="color:red"></h:outputText>
</h:panelGroup>
I tested using:
p:ajax event="keyup"
p:ajax event="blur"
And in both situations when you bring the value typed into the method it gets missing the last character Return example:
Valor do sku digitado: 33221
I put an outputText in the excerpt presented to verify what was being printed and returns the correct value.
Hasanyoneeverhadthis,andwouldhaveasolutiontothisproblem?
Iamusinginmybean@ViewScopedandsearchthevaluetypedwith:
System.out.println("Valor do sku digitado: " + produto.getSku());