Ajax Widget Counter Problem

Hello comunity of yii, glad to programm on this great framework.

i got a problem with ajax

so i need widget with variable witch will increase on 1 on every ajax request, but it increase on 1 only on first request.

my controller


public function actionAjaxTest() {

$valuetestcontr=$_GET['value']+1;

$this->renderPartial('application.widgets.views.test',array('params' => array('value'=>$valuetestcontr)));

}

widget


class TestWidget extends CWidget {

public $params = array(

'action'=>'index',

);

public function init() {


}

public function run() {

$valuewidg = $this->params['value'] + 1;

if(isset($_GET['value']))

$valuewidg = $this->params['value']+2;

$this->render('test',array('params' => array('value'=>$valuewidg)));

}

}



view of widget


<?php

$valuetest=$params['value'] + 1;


echo '<div id=ajaxtest> value = '. $valuetest; 


echo CHtml::ajaxLink(

'<i class="icon-chevron-left"></i>',

Yii::app()->createUrl(Yii::app()->controller->id . '/ajaxTest'), //<-CONTROLLER

array(

'type'=>'GET',

'data'=>array(

'value' => $valuetest,

),

'update' => '#ajaxtest'

) 

);


echo '</div>';

and widget call in controller view


$this->widget('testWidget', array('params'=>array('value'=>1)));

i stucked with it from july, need to finish till NY, so will be glad on any response, thx.

increase it by session in ajax controller’s action

thx for your suggestion, i don’t made any session in project for now, will read about it.

i think i need more simple way to made it with only _GET or it’s impossible? so i need to have in GET variable $var+1 and not $defaultvar on widget start.

i need somthing like this to get it work

http://www.yiiframework.com/forum/index.php/topic/41131-ajax-parameters-arent-sent-with-ajaxlink/page__p__196270__fromsearch__1#entry196270