dependent dropdown in jappendo


I want to use dependent dropdowns in my jappendo. I have written the following code so far which is static and works. I want to make it dynamic.


 $product = CHtml::listData(Products::model()->findAll(),'product_id','product_name');  

			echo CHtml::DropDownList('product_id[]','',$product,  array(

				'prompt'=>'Select Location...', 

			 'ajax' => array('type'=>'POST',  

		 'url'=>  Yii::app()->createUrl( "PurchaseOrder/units"), 





                               <div id="param_id"  class="row">



       <?php echo CHtml::DropDownList('unit[]','',array(prompt=>'select')); ?>




And in my controller:

public function actionUnits()


$product_id =  $_POST['product_id'][0];// this makes it static. i want to fetch product_id dynamically


                  array(':product_id'=> $product_id));



    foreach($data as $value=>$name)


        echo CHtml::tag('option',







Please help.


Read this wiki and try again.