}
// Formatting/Parsing method "inspired by" WOTextField
@Override
public WOActionResults handleRequest(WORequest request, WOContext context) {
WOComponent component = context.component();
String strValue = request.stringFormValueForKey("value");
Object objValue = strValue;
if (strValue != null) {
Format format = null;
if (strValue.length() != 0) {
format = WOFormatterRepository.formatterForComponent(component, _dateFormat, _numberFormat, _formatter);
}
if (format != null) {
try {
Object parsedValue = format.parseObject(strValue);
String formattedValue = format.format(parsedValue);
objValue = format.parseObject(formattedValue);
}
catch (ParseException parseexception) {
String valueKeyPath = _valueAssociation.keyPath();
ValidationException validationexception = new ValidationException(parseexception.getMessage(), strValue, valueKeyPath);
component.validationFailedWithException(validationexception, strValue, valueKeyPath);
return null;
}
if (objValue != null && _useDecimalNumber != null && _useDecimalNumber.booleanValueInComponent(component)) {
objValue = new BigDecimal(objValue.toString());
}