• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: valueForBindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: valueForBindings


  • Subject: Re: valueForBindings
  • From: Kieran Kelleher <email@hidden>
  • Date: Mon, 23 Apr 2007 21:50:36 -0400

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.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >valueForBindings (From: Michael Warner <email@hidden>)
 >Re: valueForBindings (From: Kieran Kelleher <email@hidden>)
 >Re: valueForBindings (From: Jean-François Veillette <email@hidden>)
 >Re: valueForBindings (From: Mike Schrag <email@hidden>)
 >Re: valueForBindings (From: Kieran Kelleher <email@hidden>)
 >Re: valueForBindings (From: Mike Schrag <email@hidden>)
 >Re: valueForBindings (From: Kieran Kelleher <email@hidden>)

  • Prev by Date: Re: EOModeler and boolean
  • Next by Date: Re: EOModeler and boolean
  • Previous by thread: Re: valueForBindings
  • Next by thread: Re: valueForBindings
  • Index(es):
    • Date
    • Thread