Onde o atributo é um BigDecimal. Utilizo desta forma em outros lugares no sistema ele funciona perfeito, mas neste caso ele esta dentro de um Dialog e apresenta:
{0}: Ocorreu um erro de conversão.
Esta indo com virgula, pois estou usando o jQuery-MaskMoney.
Criei um converter e estou ajudando. Esta seria a melhor forma?
Passou a funcionar após o Converter.
`@FacesConverter(“bigDecimalConverter”)
public class BigDecimalConverter implements Converter {
// private static final BigDecimal UPPER_LIMIT = new BigDecimal(9999);// private static final BigDecimal LOWER_LIMIT = new BigDecimal(-9999);@OverridepublicObjectgetAsObject(FacesContextcontext,UIComponentcomponent,Stringvalue){// if (!NumberUtils.isNumber(value)) {// throw new ConverterException(new FacesMessage("not a number"));// }value=value.replace(".","");value=value.replace(",",".");if(value.contains(".")){StringdecimalPlace=value.substring(value.indexOf("."));if(decimalPlace.length()>3){thrownewConverterException(newFacesMessage("too many numbers after decimal point"));}}BigDecimalconvertedValue=newBigDecimal(value).setScale(2,RoundingMode.HALF_UP);// if (convertedValue.compareTo(UPPER_LIMIT) > 0) {// throw new ConverterException(new FacesMessage("value may not be greater than " + UPPER_LIMIT));// }// if (convertedValue.compareTo(LOWER_LIMIT) < 0) {// throw new ConverterException(new FacesMessage("value may not be less than " + LOWER_LIMIT));// }returnconvertedValue;}@OverridepublicStringgetAsString(FacesContextcontext,UIComponentcomponent,Objectvalue){return((BigDecimal)value).toString();}