Hi,
I have the following code in the JSPX page which writes as:
<tr:column>
<f:facet name="header">
<tr:outputText value="* Amount($)" />
</f:facet>
<tr:inputText id="payAmount"
value="#{xyz.payAmount}"
simple="true"
columns="12"
immediate="true"
partialSubmit="true"
autoSubmit="true"
onblur="submit()"
valueChangeListener="#{CustomComponentBackingBean.computeAmount}"
validator="#{CustomComponentBackingBean.validateTotal}"
required="true"/>
<f:facet name="footer">
<tr:outputText
value="#{CustomComponentBackingBean.netTotal}" readOnly="true">
</tr:outputText>
</f:facet>
</tr:column>
In here I am doing validations using a custom validator in Backing Bean ,as
well as event handling which is also in backing bean,
The code for the validation is :
public void validateTotal(FacesContext context, UIComponent toValidate,
Object value) {
BigDecimal retTotal = new BigDecimal(netTotal);
if ((retTotal.floatValue() < this.getAmount().floatValue())
|| retTotal.floatValue() > this.getCurrentBalance()
.floatValue()) {
((UIXInput) toValidate).setValid(false);
FacesMessage message = new FacesMessage("Invalid Total");
context.addMessage(toValidate.getClientId(context), message);
}
computeTotal();
System.out.println("total amount is " + this.getNetTotal());
System.out.println("min balance is " + this.getAmount());
System.out.println("max balance is " + this.getCurrentBalance());
}
The event handling code works perfect fine, but when I put the
validator="#{CustomComponentBackingBean.validateTotal}"
and enter some data which will cause validations to use, validation errors are
showing up.
But when I re-enter correct values the validation messages cease to go away.
It seems that the event handling code is not being called thereafter.
Is there any thing that I am missing?
thanks and regards,
Anshuman
Disclaimer
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom it is addressed. If you
have received this communication in error, please immediately notify the [EMAIL
PROTECTED] and destroy the original message. The recipient should check this
email and any attachments for the presence of viruses. Ness has taken every
reasonable precaution to minimize this risk, and accepts no liability for any
damage caused by any virus transmitted in this email. Ness reserves the rights
to monitor and review the content of all messages sent to or from this E-mail
address, and store them on the Ness E-mail system.