0
When the submit
of form
occurs through the enter
, being focused on inputNumber
and changing its content, this new value does not update the variable in the Bean
.
However, if the 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>
Provisionally, I’m taking the value this way on Bean
:
public void salvar() {
String cat = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("meuForm:categoria_input");
...
}
Any idea how to solve this problem?