Igor Vaynberg wrote:
can you show us some code please?The code is below. The MessageValidationResult.isOk() returns false leading to a conversion exception being thrown by the converter. I can make a standalone example as well if you like. Cheers Erik package nl.jmonks.bonloon.app.components; import java.util.Locale; import nl.jmonks.bonloon.app.dataobjects.SofiNummerData; import nl.jmonks.generic.validation.MessageValidationResult; import nl.jmonks.tax.domain.SofiNummerValidator; import nl.jmonks.wicket.components.AbstractConverter; import wicket.WicketRuntimeException; import wicket.util.convert.ConversionException; public class SofiNummerConverter extends AbstractConverter<SofiNummerData> { private static final int REQUIRED_DIGIT_COUNT = 9; public SofiNummerConverter() { // Empty. } @Override public SofiNummerData convertToObject(String aValue, Locale aLocale) { aValue = aValue.replaceAll("\\s", ""); aValue = aValue.replaceAll("\\.", ""); SofiNummerValidator validator = new SofiNummerValidator(); MessageValidationResult<String> result = validator.validate(aValue); if (!result.isOk()) { throw new ConversionException(result.getMessage()); } SofiNummerData sofi = new SofiNummerData(); sofi.value = aValue; return sofi; } @Override public String convertToString(SofiNummerData aValue, Locale aLocale) { return aValue.value; } }
|
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
