First of all, thanks for those documentations. Actually, I believe none of those, truly describes this scenario, since this not just a question of having two models, because that relation is ok. The issue, however, may rely on the fact that one of those models (Members) is "child" of another "Team".
I can only save Members, if I SAVE Team (to retrieve the Team ID and pass it to Members Team ID).
Then we should iterate over all Members, and,validate each of them.
I have accomplish that. No problem.
The issue relies on the validation.
I got a very bizarre behaviour:
If, on CActiveForm widget, we:
Only the Team model displays the messages. Why? No idea.
If, on CActiveForm Widget, we:
We DO get all validation messages displayed, both on Team and Member form fields.
I know that the Members are also being validated via Ajax, because, I can see the message that
I setup on the MODEL Rules method. Why like this it works for both? No idea.
Now, the problem is:
On the form, the Members could be either 1, 2 or 3.
We wish to allow the validation ONLY on those fields that are visible.
If they aren’t visible, we shouldn’t validate that.
I’ve tried to create a beforeValidate script, to disable=disable the input fields, but the client side validation seems to NOT care about if they are disabled or not, I get messages there as well.
This is kind of hard to explain, I promise to place all my code here, for others to use once this is done, but, I would like to request if someone, could be kind enough to dispense some minutes on a chat session in order to check the issue I’m referring here.
Or, I can place, my PerformAjax validation script, my controller script, my _form partial. (but it’s really a lot of code, and I really believe a chat would be more effective).
If you believe you could help here, please PM.
IF we end up seeing that this actually, gives some work to be done properly, I don’t mind to pay from my pocket if I have to.