ajax call in jsf 2.0 (myfaces), the onevent javascipt function in the ajax tag gets called before the rendering is complete
===

This is my first time asking a question on a forum, since usually my questions have already been asked and answered. I haven't found an answer to this problem that works for me, so here goes:

I'm making an ajax call in jsf 2.0 like this:

    < f :ajax listener="#{myReferenceController.clearRequiredReferenceNumber}"
    	onevent="resetFocus" execute="@form"
    	render=":resultsForm:ResultsDisplay" />

Everything in the listener works perfectly, and the data is then rendered as expected in the data table that I have in my .xhtml page. The problem is that the javascript that I call in the "onevent" seems to be getting called before the rendering is complete, and therefore the process of resetting the focus to a column in my datatable doesn't work, since the datatable is removed and then re-added to the DOM when the ajax is finished re-rendering. 

I'm looking in my javascript for the status of "success", in hopes that at this point, the rendering would have completed. Alas, this is not the case, and my getelementById (actually dojo.byId) is not finding the element in the datatable. I know my javascript function works under normal circumstances, since I'm calling this same function in a situation where there is not an ajax call, and everything works perfectly there.

If I could just avoid rendering the cell in the table that I'm trying to set focus to, that would be great, but my listener is making changes to this cell in the ajax call. I'm at my wits end, so any ideas on this would be very appreciated.

Thanks in advance,

James W.