Widget In Loop

This is the most important note, when you are putting widget in any loop.

Here we have to distinct any number of instances of widget.

So we are providing ID to widget.

‘id’ property should in htmlOptions.

eg.

$i=0; // provide different id

foreach($model as $list)

{

$this->widget(‘zii.widgets.jui.CJuiDatePicker’, array(

‘htmlOptions’=>array(

‘id’=>$i; ),

);

$i++;

}