try/catch at end of validationFailedWithException. See pg 146 in PWO for force values discussion. .... for example.........
<snip> public void validationFailedWithException(java.lang.Throwable exception, java.lang.Object value, java.lang.String keyPath) {
// create an error dictionary key by replacing the dot separators in the keyPath String errorDictKey = keyPath.replaceAll("[.]","_");
// set the validation error string to be displayed valiDict().setObjectForKey(exception.getMessage(), errorDictKey);
// set the page=level boolean that can be checked in invokeAction so we can decide to take no action and return the current // page since it has errors to be corrected setHasValidationErrors(true);
// So that the user gets a display of what they entered, just try and force // the value anyway. It's not going anywhere with invalid data anyway. if ( value != null ) { try { takeValueForKeyPath(value,keyPath); } catch(Exception e) { // Just ignore it if it does not take } } } </snip>
On Apr 23, 2007, at 9:05 PM, Dana Kashubeck wrote: - Attribute errors are pushed into the subcomponent's error dictionaries in validationFailedWithException (and failed values are forced with try/catch/ignore into attributes after failure so the user gets back what they entered and they have an opportunity to correct it)
Are you forcing the failed values into the form fields themselves, or do they appear in your error messages? If you are putting them in to the fields, I'd love to know how. I've bumped in to issues trying to implement that sort of functionality.
|