Yii- Ajax Value Not Getting Fired Into Controller

I’m new to Yii framework and Ajax. So now I’m using a ext.combobox.EJuiComboBox for creating a dropdownlist. Below is the code I’m using to create the dropdownlist in the view file :




    <?php

    $this->widget('ext.combobox.EJuiComboBox', array(

        'model' => $model,

        'attribute' => 'company_id',

        // data to populate the select. Must be an array.

        //'data' => $model->getAllModels(),

        'data' => CHtml::listData(Company::model()->findAll(), 'id', 'name'),

        // options passed to plugin

        // Options passed to the text input

        'options' => array(

            // JS code to execute on 'select' event, the selected item is

            // available through the 'item' variable.

            'onSelect' => CHtml::ajax(array(

    				'type'=>'POST',

    				'url'=>CController::createAbsoluteUrl('bill/getProjects'),

    				'update'=>'#'.CHtml::activeId($model,'project_id'),

                                    'beforeSend' => 'function(){

                                        $("#page").addClass("loading");}',

                                    'complete' => 'function(){

                                        $("#page").removeClass("loading");

                                        $("#' . CHtml::activeId($model,'project_id') . '").trigger("change");

                                    }',

                                   'success'=>"function(){

                    alert('ok');}"

    

    			)),

            // JS code to be executed on 'change' event, the input is available

            // through the '$(this)' variable.

            

            'allowText' => false,

        ),

        // Options passed to the text input

        'htmlOptions' => array('style'=>'width:70px'

    			)

    )); ?>



Now, the ajax gets fired to controller, but the value of project_id is still 0. Now in the controller I have the following function. The alert box gets executed.




    public function actionGetProjects()

    	{

    		$data=Project::model()->findAll('company_id=:company_id',

                array(':company_id'=>(int) $_POST['Bill']['company_id']));

    

    		$data=CHtml::listData($data,'id','name');

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

    		{

    			echo CHtml::tag('option',

                    array('value'=>$value),CHtml::encode($name),true);

    		}

    	}



In the logs generated I can see though I selected the company_id from values, the comapny_id says the value is 0. How can I debug this?




    SELECT * FROM `project` `t` WHERE company_id=0



I don’t see why company_id is passed as 0 when company_id is selected from value from dropdownlist