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?