need some help with ajax

in this article:http://www.yiiframework.com/wiki/87/ajax-update

in the end he says

[html]Pay attention that the ID are authomatically generated by yii by incrementing a counter, when you do your renderPartial, there is the possibility that the newly generated id will confilct with the id of the other part of the page.

If you have some problem with the clientscripted object (link, jui widget and so on) after an ajax update, it is possible that you have to set the id to all this items, in order to avoid this conflicts.[/html]

so i think that its what happed to me but i not understand how to solve it.

i have a CListView order by counter

in each item there is a ajax button that increase or decrease the counter

the problem is when for example:

item#1(counter:4)

item#2(counter:5)

now if i increase item#1 counter by 2 so now the list look like that:

item#2(counter:6) //the order changed so now item#2 is in the top

item#1(counter:5)

but the ajax button on each item is still connected to the other item

so if i press on the button of item #1 it update item#2

i found a solution after 5 days with this problem http://www.yiiframework.com/forum/index.php/topic/30469-a-little-problem-with-ajaxbutton-inside-clistview/

if this is my ajaxbutton:


echo CHtml::ajaxButton("- $data->id", CController::createUrl('projects/AjaxPlusMinus/', array('id' => $data->id, 'x' => '-1')),array('update' => '#ajaax'));

needed to give them id by myself and dont count on yii to do that:


echo CHtml::ajaxButton("- $data->id", CController::createUrl('projects/AjaxPlusMinus/', array('id' => $data->id, 'x' => '-1')),array('update' => '#ajaax'), array('id'=>"decrease$data->id"));