RenderPartial in CJuiTabs

Hi, I’m newbie in YII… Very Cool :)

Any idea how to validate the form using RenderPartial in CJuiTabs.

When I RenderPartial it outside the CJuiTabs it works fine. But not in CJuiTabs.




//view file


<?php

$this->widget('zii.widgets.jui.CJuiTabs', array(

	'tabs' => array(

		'My Contacts' => 'das',

		'Groups' => $this->renderPartial("_groups", array('Groups' => $Groups), true),

		// panel 3 contains the content rendered by a partial view

		'Find Users' => array('ajax' => $this->createUrl('/user/user/')),

	),

	// additional javascript options for the tabs plugin

	'options' => array(

		'collapsible' => true,

	),

	'cssFile'=>false,

));


//$this->renderPartial("_groups", array('Groups' => $Groups));

?>



//__groups view file to render




<?php if(Yii::app()->user->hasFlash('user')): ?>

	<div class="success">

        <?php echo Yii::app()->user->getFlash('user'); ?>

	</div>

<?php else: ?>


    <div class="form">

        <?php $form=$this->beginWidget('CActiveForm', array(

            'id'=>'GroupForm',

            /*'enableAjaxValidation' => true,*/

            'enableAjaxValidation' => true,

            'clientOptions' => array('validateOnSubmit'=>true),

            //'disableAjaxValidationAttributes'=>array('RegistrationForm_verifyCode'),

            'htmlOptions' => array('enctype'=>'multipart/form-data'),

        )); ?>

        <?php echo $form->errorSummary(array($Groups)); ?>

        <div id="what" class="eventAction">

           

            <div class="row">

                <?php echo $form->labelEx($Groups,'Group Name:'); ?>

                <?php echo $form->textField($Groups,'title'); ?>

                <?php echo $form->error($Groups,'title'); ?>

                <?php echo CHtml::submitButton("Create"); ?>

                

               

            </div>

              <?php $this->endWidget(); ?>

    		 <div class="clear"></div>

    	</div> 

    </div> 

    

    

  

  <?php endif; ?>   



Any idea?

I understand that after validate the form the tab wich contains the validated from should be selected.

if so there is an option you can use




'options' => array(

        'selected' => $selected,


),



After validate the form from the contoller you should send the $selected varailable with value 1 to view.


$selected = 1;

then the second tab will be selected.

Validation will be performed as usual.