<div class="companyForm">
<?php
$this->widget('zii.widgets.jui.CJuiTabs', array(
'tabs'=>array(
Yii::t('company','Dati generali') => array(
// 'content' => $this->renderPartial('_formCompany', array('model'=>$model), true ),
'content' => 'Form company',
),
Yii::t('company','Contatti') => array(
'content' => $this->renderPartial('_formContact', array('model'=>$model), true ),
),
Yii::t('company','Categorie') => array(
'content' => $this->renderPartial('_formCategory', array('model'=>$model), true ),
),
),
)
);
?>
</div>
Come vedete, i renderPartial hanno tutti il parametro final a true. Questo, stando alla documentazione, abilita l'esecuzione del javascritp in esso contenuto
Quote
Postprocesses the output generated by render(). This method is invoked at the end of render() and renderText(). If there are registered client scripts, this method will insert them into the output at appropriate places. If there are dynamic contents, they will also be inserted. This method may also save the persistent page states in hidden fields of stateful forms in the page.
Nel mio javascript, intercetto il cambiamento di una variabile php per decideere se effettuare o meno la visualizzazione dinamica di un errore, oltre ovviamente ad avere il codice html/php necessario per i dati
<script type="text/javascript">
var esit = "<?php echo $esit; ?>";
console.log ("Esit: '" + esit + "'");
var errorSelector = $('#Company_newCategoryId_em_');
errorSelector.hide();
if (esit!="" && esit !='ok' ) {
errorSelector.html(esit).show();
}
</script>
Questo codice in realtà VIENE ESEGUITO.
Il problema risiede nel fatto che l'output di questa riga è vuoto, per cui il javascirpt non ha nulla su cui agire
<?php echo $form->error($model, 'newCategoryId',array('class'=>'mws-error')); ?>

Help












