Monday 25 February 2013

ADF: Decimal Number validator



## Decimal Number validator


public void Number_validatorDecimal(FacesContext facesContext, UIComponent uIComponent, Object object)
{
       BigDecimal value =(BigDecimal)object;
       if (value == null) {
           return;
       }
       if(value.floatValue()<0.00){
           String error = "Value should be greater than zero.";
           throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, error, null));
       }

   }

No comments:

Post a Comment