$This->Render Does Not Render


I have an action in my controller which performs $this->render when i change a value in a Dropdownlist. This is done by AJAX and JQUERY. Unfortunately the only thing that happens is that in the POST response there is the whole page that should be rendered. But the page itself does not update. Why is that?

In my view:

Yii::app()->clientScript->registerScript('show', "





        function loadData()




                        type: 'POST',

                        url: '".CController::createUrl('loadCategories')."',



                              cat: $('#cat0_name').val()



                                function (data)







In my Controller:

    public function actionLoadCategories()




            $cat = $_POST['cat'];





	public function actionIndex($array=null)


        $criteria=new CDbCriteria();



            foreach($array AS $key => $value)





        $dataProvider=new CActiveDataProvider('Objects',array(








                'conditions' => $array, 'dataProvider'=>$dataProvider),false,true);





                'conditions' => $array, 'dataProvider'=>$dataProvider));



So in conclusion: I click on an entry in the dropdown, I see nothing but when I look at the Post response via firebug I see that the whole page that should be rendered is the response of the request.

I see that you are updating a dom element with the id ‘test’




Check if this element is really defined (i.e. <div id=’#test’>)

How can I update the whole page instead of a dom Element?

I don’t get why executing the render method does not rerender the page itself …

Really nobody? :(

I don’t need the success thing, do I? Because via

url: '".CController::createUrl('loadCategories')."'

I tell the application what to do. In the action it says what to render or not?

I have the same problem.

I have a modal window which i am doing certain action (insert, update …) and i want to have a button that render to another view.

First try:

echo CJSON::encode(array('status'=>'200', 'redirect'=>  Yii::app()->createAbsoluteUrl('products/view')));

and have in your button






                      if(data.status == 200)




                      } else {

                                some error message



the above change the url but the view is not rendered.

Second try:

No success on the button

but in the controller action of insert i have


the above generate the html code (saw it in firebug) but didn’t change the url of the browser.

So obviously i do something really wrong if anyone can help i would appreciate.