activeCheckboxList and MANY_MANY (again ;))

Hi all.

I want to use checkbox list for MANY_MANY relations.

According to this link, activeListBox can use related data as initial selection.

Works like charm.

But when I try to use activeCheckboxList instead of a listBox, no checkboxes are checked.

Of course, I can set selection manually, by using afterFind and all that stuff, but I wonder if there is another way.

anyone?..

why not use chtml checkboxlist?


public static string checkBoxList(string $name, mixed $select, array $data, array $htmlOptions=array ( ))

ex:


<?php $data = CHtml::listData(MyModel::model()->findAll(), 'id', 'name');

     

                echo CHtml::checkBoxList('id', $select, $data); ?>

I’m sure there are a lot of workarounds :)

Just wondering why activeListBox can and activeCheckBoxList can not.