Using CJui functions and Ajax buttons

Wasted some hours with nice AjaxLink and ajaxSubmitButton stuff in a view loaded with CJuiTabs, just to find out that Yii is giving the same name to all generated buttons, and only change them in the same view.

That gives issues when there is already a #yt0 button somewhere in a (hidden) tab, generated is an earlier (tab) view. To save you some hours searching: use the htmlOptions() array and give your button/link a unique name (not id).

Something like this in your view:

echo CHtml::ajaxSubmitButton('Save',array('update','id'=>$data->id), $ajax, array('name'=>'saveunique'));

Thanks, Maxximus, I just spent a few hours on this myself.