Update Portlet In Sidebar Using Ajax In Another View

I need to update portlet in sidebar using the CHtml ajaxsubmitbutton in another view.

I am not sure if this was answered before now.

and example might help here even hypothetical example

For example:

I have a form (view) that uses the ajaxsubmitbutton to add selected item(s)- displaying item name and price - to a gridview. each new addition causes the gridview to be refreshed. At the same time I want to update a shopping cart portlet with the number of items selected and the total price of the same selected items.

when you send the data to the server after updating the gridview use same info to update the items and price paste your code if you want me to give you example

Please see the attachment.

paste your view and controller both and dont attach just paste it and highlight it

Here is the code for updating the repair table after the user select a job from a dropdownlist using ajaxsubmitbutton:

public function actionJobProcess() {

	$model=new Repairdetails;



		$job = $_POST['job'];



		$model->JobID = $this->job_id;

		$model->RepairID = Yii::app()->session['repair_id'];

		$model->UnitPrice = $this->list_price;


		echo "Ok";



		throw new Exception("Sorry, cant create a Repair Job",500);




Then I have a myql view that select the rows in the repair table and calculate the extended price. In yii I created a model based on the view. It is this view I am displaying in the gridview using the following code on the above ajaxsubmitbutton:


echo CHtml::ajaxSubmitButton('Select',


	array('success'=&gt;'function() {




























    'footer'=&gt;&quot;Repair Total: &quot;.Vrepdetails::model()-&gt;fetchTotalPrice(Vrepdetails::model()-&gt;search()-&gt;getData()),





Here is the respective code in the Vrepdetails model associated with the view:

public function search()


	// Warning: Please modify the following code to remove attributes that

	// should not be searched.

	&#036;criteria=new CDbCriteria;









	return new CActiveDataProvider(&#036;this, array(




public function fetchTotalPrice(&#036;records)



    foreach(&#036;records as &#036;record)


    return &#036;price;


I also want to show the total price also in a portlet in the sidebar.

I solved the problem by using clips and using an action in the controller.