the question is, how exactly you want to track the changing of focus?
-Matej Johan Compagner wrote:
if i have an ajax behavior on a text field event: onfocus and i set the background and then add that component to the ajax event for redraw then i loose focus. Ofcourse there are ways to go around that.. for example i could just write the style tag out instead of the complete component. But what when it gets a bit harder? (like a parent is altered and rerendered) i could attach a behavior (onfocus) to all components and let them set the last know focus component. And then append to every ajax call a script: if (lastfocuscomponent) lastfocuscomponent.focus(); the problem with this is that this focus gained should be ignored if there was an ajax focus gained event that the server wants to receive , else you could have an endless loop. Can't wicket do this for the developer? so track the latest focus component when an ajax call is dispatched. And when it returns set the focus back (and then ignore that focus gained event...) johan