Primefaces 5.2 inputNumber does not send the updated value to the Bean

0

When submit of form occurs through enter , being focused on inputNumber and changing its content, this new value does not update the variable in Bean . However, if submit occurs by clicking the button, the value is sent to Bean correctly.

<h:form id="meuForm">
...
    <pe:inputNumber id="categoria" value="#{bean.categoria}" decimalPlaces="0" required="true" requiredMessage="..." disabled="#{bean.categoriaDisabled}" emptyValue="empty" autocomplete="off">
        <f:validateLongRange minimum="1"/>
        <p:ajax listener="#{bean.categoriaChange}" update="valor"/>
    </pe:inputNumber>
...
    <p:commandButton id="btnSalvar" value="Salvar" actionListener="#{bean.salvar}" update="@form,:growl"/>
...
    <p:defaultCommand target="btnSalvar"/>
...
</h:form>

Temporarily, I'm getting value this way in Bean :

public void salvar() {
    String cat = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("meuForm:categoria_input");
    ...
}  

Any ideas how to solve this problem?

    
asked by anonymous 13.09.2015 / 00:34

1 answer

0

Have you tried to set the processing scope of p:commandButton ?

process="@form" or process=":meuForm"

And maybe use a ajax="false" .

    
14.09.2015 / 20:39