ajax link: passing parameter to data

THis is how I get the active tab from yiiTab.

Now I would like to pass the content of var datastr to my controller instead of simply 'display=mosaic" .

Anyone got an idea ?

echo CHtml::ajaxLink(

	'/images/mosaic.png', 'mosaic',array('width'=>16)),'',







			// gets the active tab (starts at 1 )

			var curtab=$(".yiiTab ul.tabs").find("a.active");

			var href=curtab.attr("href");

			var pos=href.substring(4); //get rid of "#tab" prefix

			var datastr="display=mosaic&tab="+pos;

			// alert(datastr);





		'error'=>'function(msg){alert("An error has happened");}'



I am now passing values by POST type

and having


where I use an input to store the value

see this post activecheckbox-with-ajax )

However this works but a little bit late (If I press a second time I can see the value is passed). It’s like beforeSend event doesn’t recreate data when fired.

I tried


to set the data from inside beforeSend without success.

Someone has an idea how to update the data before sending the Xhtmlrequest ?