ajax4jsf - a4j:ajax nested on h:inputText prevents execution of h:commandButton action on first click -
i have following code:
... <h:inputtext id="valormoedalocal" value="#{pagamentoregistrarmb.valormoedalocal}" styleclass="right dinheiro" size="12" maxlength="12"> <f:convertnumber type="number" minfractiondigits="2" maxfractiondigits="2" /> <a4j:ajax event="change" execute="valormoedalocal" render="valorpagamento" listener="#{pagamentoregistrarmb.calculavalorrealourocorrecao}" /> </h:inputtext> <h:outputtext id="valorpagamento" value="#{pagamentoregistrarmb.valorpagamento}" maxlength="12"> <f:convertnumber type="number" minfractiondigits="2" maxfractiondigits="2" /> </h:outputtext> ... <h:commandbutton id="cbcorrigir" value="#{messages['label.corrigir.pagto']}" action="#{pagamentoregistrarmb.validarcorrecao}" disabled="#{empty pagamentoregistrarmb.idrequerimentomovimentocorrigir}"> <f:param name="id" value="#{pagamentoregistrarmb.bean.id}" /> </h:commandbutton>
if change content of field valormoedalocal , click on button cbcorrigir, ajax nested on inputtext executed , action button cbcorrigir not executed; requires second click execute.
this happens because when click on button, inputtext looses focus , caauses ajax executed, preventing following executions. there way avoid undesired behavior?
Comments
Post a Comment