HI Micha
I do not understand your requirements well hence I am guessing here...
I would do it in onAfterRendering() and also in this function, check if the model exists and if it has data.
We can definite help you better if you can provide some sample code.
-D