Hey,

@Jeremy:

That's what I did after  few tries.

I set the fields where I need foreign keys to static values, checked
the user-input of every model with $this->model->validates() and if
sth. is wrong, I invalidate the field so I can put error messages
besides the normal validation ones wherever I want to. When all user-
given data is validatet, I save the models and use the id's to set the
fields of the related models.

It wasn't so bad at all, but when you use invalidate() you have to
consider some REALLY important things, such as no use of READ in the
action, as this will break the displaying of the field-related error
messages (believe me, it does, and it took me quite a bit to figure
that out!)

Also you need to save the output of $this->model->invalidFields()
because when you don't, error displaying is broken again. That's a
known issue, hope they'll fix it in Cake 1.3.

This was a tricky one, but in the end I'm really happy it worked out!

:)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to