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.
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?
janine
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 = "">
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 } }
|