Re: validationFailedWithException not being called
Re: validationFailedWithException not being called
- Subject: Re: validationFailedWithException not being called
- From: Chuck Hill <email@hidden>
- Date: Thu, 7 Jun 2007 14:59:49 -0700
On Jun 7, 2007, at 2:41 PM, Janine Sisk wrote:
Ok, just so this makes sense in the archives, and I make sure I
understand what you're telling me:
The WOFileUpload is bound to imageData, an instance variable,
instead of bigImage, an EO attribute, to avoid wiping out the value
of bigImage in the situation where the user is editing a record and
doesn't upload a new image. So we bind the value to imageData and
then setIimageData sets bigImage to the new value if it's not empty.
Yes, WOFileUpload is kind of funky in how it is implemented.
So what Chuck is suggesting, if I am understanding him correctly,
is to replace the current line
displayBoard().setBigImage(imageData);
in setImageData with
displayBoard().validateTakeValueForKey(data, "bigImage");
which will do the assignment and also cause validateBigImage to be
called before we get to saveChanges, which will then cause
validationFailedWithException to run.
Did I get that right?
Yes.
Chuck
On Jun 7, 2007, at 2:27 PM, Chuck Hill wrote:
On Jun 7, 2007, at 2:24 PM, Janine Sisk wrote:
BigImage : WOFileUpload {
mimeType = displayBoard.mimeType;
data = imageData;
OK _that_ is not going to validate during takeValues by itself.
displayBoard.bigImage will. IIRC, you want
public void setImageData(NSData data) {
if (data != null) {
displayBoard().validateTakeValueForKey(data,
"bigImage"); // not sure about attribute name
}
}
--
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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden