• 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: EOF validation messages questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOF validation messages questions


  • Subject: Re: EOF validation messages questions
  • From: Ramsey Gurley <email@hidden>
  • Date: Wed, 19 Oct 2011 13:35:27 -0700

Hi Mike,

On Oct 19, 2011, at 10:52 AM, Michael Gargano wrote:

Hi all,

I'm still having some occasional issues with EOF validations (2 things in particular)...


1) For some attributes (it seems like attributes that are type intNumber, but there may be others too), I'm getting validation error messages that end with "is not a valid ?".
I had that problem the other month on all my attributes, but it had to with the d2w libs I had in the build path at the time, those are gone now and I don't know why this happens or the best way to handle it.

In ERExtensions ValidationTemplate.strings file I see:

"ValueConversionException" = "The value entered for <b>@@displayNameForProperty@@</b> is not a valid <b>@@attribute.valueClass@@</b>.";

The display name for your property is created correctly because there is a displayNameForProperty() method on ERXValidationException.  

There's no attribute() method on ERXValidationException, so it goes to the validation context object for an answer.

If you don't have a validation delegate to supply a context and you haven't set a context manually, you end up with a '?' replacement character.


2) Somewhat related to this... I have some EO attributes with names that make sense in the business domain, but should be called something else when surfaced to the user.  So, the attribute might be fancyBusinessObjectName, but when I catch the exception and show the message I want it to be displayed as "User Non Scary Name".

Is there a way to do either of these things without just doing string replacements on the message from the exception, perhaps something in userInfo?


Thanks.
-Mike

In the example above, you could add something like:

"PropertyKey.fancyBusinessObjectName" = "User Non Scary Name";

To your english strings file and get the desired results. It's also done as

"MyEntityName.fancyBusinessObjectName" = "User Non Scary Name";

In some places. Not sure which will work for you.  


Ramsey

 _______________________________________________
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

  • Follow-Ups:
    • Re: EOF validation messages questions
      • From: Michael Gargano <email@hidden>
References: 
 >EOF validation messages questions (From: Michael Gargano <email@hidden>)

  • Prev by Date: EOF validation messages questions
  • Next by Date: Re: EOF validation messages questions
  • Previous by thread: EOF validation messages questions
  • Next by thread: Re: EOF validation messages questions
  • Index(es):
    • Date
    • Thread