Yii Framework Forum: CJuiTabs with same model in different tab - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CJuiTabs with same model in different tab

#1 User is offline   marisalima 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 55
  • Joined: 11-April 14

Posted 22 September 2015 - 03:44 AM

Hello.

I have one CJuiTabs with multiple tabs.
My problem is in different tabs using the same model. In the first tab, I update the model and the second tab I create a new record in the database.
My code is:

<div class="form">
<?php
$form=$this->beginWidget('CActiveForm',array(
'id'=>'default-parent-form',
'enableAjaxValidation'=>false,
));

?>
<?php
$tabs['Dados Pessoais']=array(
'id'=>'DadosPessoais',
'content'=>$this->renderPartial('_formPag1',array(
'form'=>$form,
'model1'=>$model1,
'model2'=>$model2,
'colaborador'=>$colaborador,
),
true)
);

$tabs['Competências']=array(
'id'=>'Competências',
'content'=>$this->renderPartial('_formPag2',array(
'form'=>$form,
'items'=>$itemsCompet,
'modelCompet'=>$modelCompet,
'compet'=>$compet,
),
true)
);
$tabs['Objectivos Ano Anterior']=array(
'id'=>'ObejctivosAnoAnterior',
'content'=>$this->renderPartial('_formPag3',array(
'form'=>$form,
'items'=>$items,
'modelObj'=>$modelObj,
),
true)
);


$tabs['Novos Objectivos']=array(
'id'=>'DefinirObjectivos',
'content'=>$this->renderPartial('_formPag4',array(
'form'=>$form,
'obj'=>$obj,


),
true)
);

$tabs['Acção de Formação']=array(
'id'=>'Formação',
'content'=>$this->renderPartial('_formPag5',array(
'form'=>$form,
'forma'=>$forma,
'pif'=>$pif,

),
true)
);
$tabs['Resultado']=array(
'id'=>'resultado',
'content'=>$this->renderPartial('_formPag6',array(
'form'=>$form,

),
true)
);
$tabs['Comentários']=array(
'id'=>'Comentários',
'content'=>$this->renderPartial('_formPag7',array(
'form'=>$form,
'momento'=>$momento,

),
true)
);



$this->widget('zii.widgets.jui.CJuiTabs',array(
'tabs'=>$tabs,
'options'=>array(
'collapsible'=>false,
),
));


?>
<br>
<div style="margin-left: 930px">
<?php

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

'name'=>'submit',

'caption'=>'Enviar',

'htmlOptions'=>array(

'style'=>'background:#006600;color:#ffffff;',

),

));

?>
</div>




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

In the tab Goals Last Year I update this data and in the tab New Goals I create the new Goals, but in the first tab I use tabular input for to save the data.
The problem is when i try save the model simultaneous.
I try this wiki http://www.yiiframew...simultaneously/, but I can't save the data.
Please a need help.
Sorry my bad English.
Thank You for your attention!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users