On Jun 17, 2008, at 11:09 AM, Ralf Schuchardt wrote:


Am 17.06.2008 um 19:32 schrieb Chuck Hill:


On Jun 17, 2008, at 10:04 AM, Ralf Schuchardt wrote:

Hi,

in the past (until WO 5.4) I often have used a WOTextField with a formatter to prevent errors like this:

"java.lang.IllegalArgumentException: While trying to invoke the set method "public void com.cx.harow.eos._ArztFolgedokLeistung $StorageClass.setAnzahl(java.lang.Short)" on an object of type com.cx.harow.arzt.dokumente.ArztFolgedokumentationContext $TempFolgedokLeistung we received an argument of type java.lang.String. This often happens if you forget to use a formatter."

When a value was invalid the formatter did not set an invalid value in my objects.

Now, in WO 5.4 this is no longer true. When the formatter fails to parse a string it still gets pushed into the target object. As this is documented is must somehow be considered "expected" behavior. Unfortunately this breaks all our apps, as no class handles those invalid strings.

Whoa!  Where is this documented?  I also depend on this.

WOTextField:

formatter
[...]

If a user enters an “unformattable” value, WOTextField passes the invalid value through, allowing you to send back an error page that shows the invalid value.

[...]

Uh oh.  Are you saying that it no longer calls

 void
validationFailedWithException(Throwable t, Object value, String keyPath)
Called when an Enterprise Object or formatter failed validation during an assignment.

When the format operation fails? That is a bug. Or a totally unacceptable API change.

Chuck


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to