Well, I got it. Mea maxima culpa.
In the controller, I was setting the select[Model] array with only one
index. Instead of:

if(empty($this->data['Model']['Model'])) { $this->data['Model']
['Model'] = null; }
$this->set('selectedModels', $this->data['Model']['Model']);

I was trying:

if(empty($this->data['Model'])) { $this->data['Model'] = null; }
$this->set('selectedAreas', $this->data['Model']);

This was bombing out at the _selectedArray method of the controller
class. After some hours scattering var_dumps here and there, the
problem became obvious. Hope with time and experience I start to get
these kind of stupid mistakes faster. Or avoid them.
Norman

On 16 fev, 20:36, "Norman" <[EMAIL PROTECTED]> wrote:
> Forget about my previous post, and my sincere apologies to Evan Sagge,
> his fine piece of code have no connection with my misery. I "baked"
> from ground up the models, controllers and views for the tables
> involved and the vanilla CakePHP validation is presenting the same
> behavior with multiple select listboxes. If any field does not
> validate, the multiple selects loose their selected options.
>
> Norman
>
> On 16 fev, 20:06, "Norman" <[EMAIL PROTECTED]> wrote:
>
> > One thing I am sure about: This problem is not related with the
> > "vanilla" CakePHP 1.1 validation. Im using "Evan's CakePHP Validation
> > Technique 2.0" (http://blog.evansagge.com/2006/12/28/evans-cakephp-
> > validation-technique-20/) and Im pretty sure theres a bug at the
> > validation class causing this behavior with multiple select boxes. But
> > I was not able to find it.
>
> > Norman
>
> > On 16 fev, 12:34, "Norman" <[EMAIL PROTECTED]> wrote:
>
> > > I have some views for a model with a mix of fields, two of these


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

Reply via email to