Select next tab after create action

Dear Guys,

I’ve a tab shows four steps, the default one is the first one, to navigate to the second one I’v to fill all the required data into the first tab, then after create action I should select the second tab.

I already did that, as following:

<a id="lnkNext" href=<?php $url = CController::createAbsoluteUrl("events/create");

echo ‘"’.$url.’"’ ?>

onclick="$(’#yw2’).tabs(‘select’, 1);">Save & Next</a>

But when I click the link ‘Save & Next’ it selects the next tab but returns to the first one, it flickers.

Here you are the create action code, might help:

public function actionCreate()

{


	&#036;model=new Events;





	&#036;ageRangeList = new EventExpectedCampers();


	&#036;validatedItems = array();


	


	if(isset(&#036;_POST['Events']))


	{


		&#036;model-&gt;attributes=&#036;_POST['Events'];


		if(&#036;model-&gt;save()&amp;&amp; MultiModelForm::validate(&#036;ageRangeList,&#036;validatedItems,&#036;deleteItems))


		{


			&#036;masterValues = array ('EVENT_ID'=&gt;&#036;model-&gt;EVENT_ID);


			if (MultiModelForm::save(&#036;ageRangeList,&#036;validatedItems,&#036;deleteMembers,&#036;masterValues))


			{


				&#036;_SESSION[&quot;EventId&quot;] = &#036;model-&gt;EVENT_ID;


				


			}


		}


	}





	&#036;this-&gt;render('create',array('model'=&gt;&#036;model,'ageRangeList'=&gt;&#036;ageRangeList,'validatedItems' =&gt; &#036;validatedItems,));


}

Your onclick event is switching to the next tab, but then on save (create) the page is essentially reloaded, defaulting to the first tab again.

Pass another variable through render() which determines the tab that should be active, then set that tab active in the view with php or javascript.