I would add to (almost) always call super.validateForSave() first.
All your mandatory attributes are tested so you don’t need to write:
if (myAttribute() != null) {
// check some stuff
}
Your mandatory attributes can’t be null after super.validateForSave().
There are some rare circumstances where you write your own code before (like
checking invisible attributes for example).
Philippe
---------------------
http://twitter.com/prabier
On 23 juil. 2014, at 15:58, Markus Ruggiero <[email protected]> wrote:
>
> On 23.07.2014, at 14:36, Theodore Petrosky <[email protected]> wrote:
>
>> that’s what it was. I didn’t call super.validateForSave in the validate
>> method. Interesting that the string fields function without the super call.
>>
>> BTW, is there an example of the correct signature for validateForSave. I am
>> googling and can’t seem to find an example of what it should look like
>>
>
> Let Eclipse show you. Type validateforsa <ctrl-space> and you're good to go
>
> @Override
> public void validateForSave() throws ValidationException {
> // TODO Auto-generated method stub
> super.validateForSave();
> }
>
>
>
> Markus Ruggiero
> [email protected]
> Check out the new book about Project Wonder and WebObjects on
> http://learningthewonders.com/
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]