JQuery UI Tabs

I’m writing a multilingual form. I’d like to use some TinyMce widget in JQuery UI Tabs.

Because I can’t use widget in widget in a view I need a little trick.

[list=1][]load alone zii.widgets.jui.CJuiTabs without data - this widget load the necessary css and js file[]initialize and generate necessary code to JQurey UI Tabs[/list]


    $(function() {

        $( "#tabs" ).tabs();



<div id="tabs">    


    <?php $tabid=0; foreach($model->pagesLangs as $foreignobj): $tabid++; ?> 

      <li><a href="#tabs-<?=$tabid?>"><?=CHtml::encode($foreignobj->languages->name)?></a></li>

    <?php endforeach; ?>


   <?php $tabid=0; foreach($model->pagesLangs as $foreignobj): $tabid++; ?> 	

 	<div id="tabs-<?=$tabid?>">

   	<?php $this->widget('application.extensions.tinymce.ETinyMce', array('name'=>'html'.$tabid, 'value'=>$foreignobj->pgtext)); ?>


   <?php endforeach; ?>   


<div class="hidden"><?php $this->widget('zii.widgets.jui.CJuiTabs'); ?></div>

Of course you can use the ajax alternative CJuiTabs example, but I don’t give up using another widgets…