Auto Open Dialog In Controller

Hi, I’m new to Yii. Basically, what I’m trying to do is to auto open a dialog. What I did is that I rendered the view that contained the widget but the problem is that the index rendered twice. I tried renderPartial but the dialog did not show.

this is my Controller

public function actionIndex() {

        $model = new Model;





This is my _dialog view


$this->beginWidget('zii.widgets.jui.CJuiDialog', array(



                'title'=>'Modal Dialog',







                ,array('model'=> $model));


So how do you actually call the dialog from the controller? or how do I render the dialog? 'Cause obviously I did something wrong. ._.

already found the answer.