I am not sure how you are passing data to carousel, you can do either of two things.
check this dropdown calling ajax and loading data in another dropdown, you can do the same with your carousal.
<?php
echo $form->dropDownList($model,'category_id',CHtml::listData(Category::model()->findAll($crietarea),'category_id','title'),
array('class'=>'form-control',
'prompt'=>'Select Category',
'ajax' => array(
'beforeSend'=>'function(){$("#Listing_subcategory_id").addClass("inputloader").attr("disabled", "disabled");}',
'complete' => 'function(){$("#Listing_subcategory_id").removeClass("inputloader").removeAttr("disabled", "disabled")}',
'type'=>'POST', //request type
'url'=> $this->createUrl('listing/Dynamiccategories'),
'update'=>'#Listing_subcategory_id',
'data'=>array('category_id'=>'js:this.value'),
))
);
?>
The above dropdown calls the action DynamicCategories and get items
public function actionDynamicCategories()
{
isset($_POST['Listing']['category_id'])? $cat_id = $_POST['Products']['category_id'] : $cat_id = $_POST['category_id'];
$data = Category::model()->findAll(array('order'=>'title', 'condition'=>'parent_id=:parent_id', 'params'=>array(':parent_id'=>(int) $cat_id)));
// your images query will replace the above
$data = CHtml::listData($data,'category_id','title');
echo CHtml::tag('option',array('value' => ''),CHtml::encode(' Select '),true);
foreach($data as $id => $value)
{
echo CHtml::tag('option',array('value' => $id),CHtml::encode(substr($value, 0, 25)),true);
}
}
I know it not good to call POST data directly from POST array but it works for sure. Second you may pass json array using CJSON::encode($array) and update your carousel accordingly.
Or just user JQuery to call the action and update the carousel data as required