title: Yii CJuiDialog isn't being recognized
body: <p>I've went through this tutorial <a href="http://www.yiiframework.com/wiki/561/ajax-login-form-with-validation-errors-inside-jquery-modal-dialog/" rel="nofollow">http://www.yiiframework.com/wiki/561/ajax-login-form-with-validation-errors-inside-jquery-modal-dialog/</a> It appears to be functioning properly, but instead of the form being in the modal dialog, it just renders it right on the page like zii.widgets.jui.CJuiDialog isn't even there.</p>
  
  <pre><code>&lt;?php $this-&gt;beginWidget('zii.widgets.jui.CJuiDialog',array(
  'id'=&gt;'login-dialog',
  'options'=&gt;array(
      'title'=&gt;'Login',
      'autoOpen'=&gt;false,
  ),
  ));?&gt;
  
  
  &lt;div class="form"&gt;
  &lt;?php $form=$this-&gt;beginWidget('CActiveForm', array(
   'id'=&gt;'user_login_form',
   'enableAjaxValidation'=&gt;false,
    'enableClientValidation'=&gt;true,
              'method' =&gt; 'POST',
              'clientOptions'=&gt;array(
                   'validateOnSubmit'=&gt;true,
                   'validateOnChange'=&gt;true,
                   'validateOnType'=&gt;false,
    ),
  )); ?&gt;
  &lt;h1&gt;
  Login&lt;/h1&gt;
  &lt;p&gt;
  Please fill out the following form with your login credentials:&lt;/p&gt;
  &lt;p class="note"&gt;
  Fields with &lt;span class="required"&gt;*&lt;/span&gt; are required.&lt;/p&gt;
  &lt;div id="login-error-div" class="errorMessage" style="display: none;"&gt;
  &lt;/div&gt;
  &lt;div class="row"&gt;
    &lt;?php echo $form-&gt;labelEx($model,'username'); ?&gt;
    &lt;?php echo $form-&gt;textField($model,'username',array("onfocus"=&gt;"$('#login-error-      div').hide();")); ?&gt;
    &lt;?php //echo $form-&gt;error($model,'username'); ?&gt;
   &lt;/div&gt;
  &lt;div class="row"&gt;
    &lt;?php echo $form-&gt;labelEx($model,'password'); ?&gt;
    &lt;?php echo $form-&gt;passwordField($model,'password',array("onfocus"=&gt;"$('#login-error- div').hide();")); ?&gt;
    &lt;?php //echo $form-&gt;error($model,'password'); ?&gt;
    &lt;p class="hint"&gt;
     Hint: You may login with &lt;tt&gt;demo/demo&lt;/tt&gt;.
    &lt;/p&gt;
  &lt;/div&gt;
  &lt;div class="row rememberMe"&gt;
    &lt;?php echo $form-&gt;checkBox($model,'rememberMe'); ?&gt;
    &lt;?php echo $form-&gt;label($model,'rememberMe'); ?&gt;
    &lt;?php echo $form-&gt;error($model,'rememberMe'); ?&gt;
    &lt;/div&gt;
  &lt;div class="row submit"&gt;
  
    &lt;?php echo CHtml::ajaxSubmitButton(
                              'Sign In',
      array('/site/login.GetLogin'),
                              array(  
              'beforeSend' =&gt; 'function(){ 
                                           $("#login").attr("disabled",true);
          }',
                                      'complete' =&gt; 'function(){ 
                                           $("#user_login_form").each(function(){ this.reset();});
                                           $("#login").attr("disabled",false);
                                      }',
                 'success'=&gt;'function(data){  
                                           var obj = jQuery.parseJSON(data); 
                                          // View login errors!
       // alert(data);
                                           if(obj.login == "success"){
                                       $("#user_login_form").html("&lt;h4&gt;
  Login Successful! Please Wait...&lt;/h4&gt;
  ");
                                       parent.location.href = "/";
                                    }
        else{
                                              $("#login-error-div").show();
                                              $("#login-error-div").html("Login failed!    Try again.");$("#login-error-div").append("
  ");
                                           }
  
                                      }' 
  ),
                       array("id"=&gt;"login","class" =&gt; "btn btn-primary")      
              ); ?&gt;
  
   &lt;/div&gt;
  &lt;?php $this-&gt;endWidget(); ?&gt;
  &lt;/div&gt;
   &lt;!-- form --&gt;
  
  &lt;?php $this-&gt;endWidget('zii.widgets.jui.CJuiDialog'); ?&gt;
  </code></pre>
  
  <p>Its suppose to render like this above so when i click the link below it opens</p>
  
  <pre><code>echo CHtml::link('Login', array('/site/login.GetLogin'), array('onclick'=&gt;'$("#login-dialog").dialog("open"); return false;'));
  </code></pre>
  
  <p>Its built in a widget, if you have a look at the tutorial. Here's the complete widget</p>
  
  <pre><code>&lt;?php
  
  class loginProvider  extends CWidget{
  
  public static function actions(){
      return array(
                 'GetLogin'=&gt;'application.components.actions.getLogin',
      );
  }
  
  public function run(){
  
      $this-&gt;renderContent();
  
  }
  
  protected function renderContent(){
  
   echo '&lt;span style="float:right;"&gt;';
   if(Yii::app()-&gt;user-&gt;isGuest){
          echo CHtml::link('Login', array('/site/login.GetLogin'),    array('onclick'=&gt;'$("#login-dialog").dialog("open"); return false;'));
   echo '&lt;/span&gt;';
   $this-&gt;getController()- &gt;renderPartial('application.components.views.login',array('model'=&gt;new LoginForm)); 
   }
   else      
   echo CHtml::link('Logout ('.Yii::app()-&gt;user-&gt;name.')', array('site/logout'),     array('visible'=&gt;!Yii::app()-&gt;user-&gt;isGuest));
   echo '&lt;/span&gt;';
     }
  
  }
  </code></pre>