提交表单时绕过ValueChangeListener

时间:2013-12-10 15:18:39

标签: jsf primefaces valuechangelistener

PrimeFaces 3.5 / Mojarra 2.1.5

我试图在尝试单击Button并提交表单时忽略ValueChangeListener。这是一种方法,而不必使用immediate = True?

<p:inputText id="txtMPM2S" value="#{ManagedBean.compPreco.valorDolar_mpm2}"
  requiredMessage="#{bundle.lblMPM2Dolar} : #{bundle.campoObrigatorio}"
  required="false" onkeypress="return isNumberKey(event)"
  valueChangeListener="#{ManagedBean.calcularValorMPMReal}">                                                    

    <p:ajax event="keyup" update="txtMPM2RS txtValorLucroTotal txtValorMargemLucroTotal"         
            process="txtMPM2S" ></p:ajax>   
</p:inputText>

<p:commandButton id="btnSalvar"
                            value="#{ManagedBean.compPreco.id != null ? bundle.btnAlterar : bundle.btnSalvar}"
                            rendered="#{not ManagedBean.actionDelete}" icon="ui-icon-disk"
                            action="#{ManagedBean.salvar()}" ajax="false" 
                            title="#{ManagedBean.compPreco.id != null ? bundle.alterarRegistro : bundle.salvarNovoRegistro}" />

1 个答案:

答案 0 :(得分:0)

我使用onclick p:commandButton:关于我的情况返回true或false ...