How to return to the active tab in yii-tab?

Hey guys,

i have implemented a form with yii-tabview. when i enter and submit invalid input data, e.g. in tab no. 2, the script returns to the first tab of the tabview, showing me the error message. has anyone a solution, how i can return to the last active tab?

kind regards

has nobody an idea? :(

CTabView has no persistant state for the selected tab. So you need to find your own solution. You could do something like:

// In your controller:

if (isset($_POST['SomeModel']))

  $activeTab='tab3'; // id of the tab with your form


  $activeTab='tab1'; // id of first tab

Then send $activeTab to your view and set it as property in your tab widget.