Yii creates a wrong id for the link (a tag, same bug with button though). this id can already be used by another ajax call in the page: the link will then submit a wrong action (ie won’t work as expected)…
If you mean on the HTML id that is generated for the link automatically… the only solution is to set a custom one as Yii always starts the automatic numbering from the beginning on every request (ajax call)
problem is that the jQuery code is not returned by the link() call… the link() method returns the HTML code… the JS code is rendered with clientscript… so those are two different things…
For this you should write your custom jQuery code and assign it to setFlash().