Legacy Application - call a Paint function

I am trying to add Vaadin components to a legacy application using the ‘div’ approach listed in the
book
.

This does not work, as my ‘div’ is added dynamically to the DOM using javascript. For example, I press a button, a new tab opens the tab contains my div ‘vaadin-here’.

I can force it to work by making the tab load when the page loads (not a real solution). Also, if I close the tab and reopen it, i see the original problem. I assume this is do to the polling that is done to see if the page has been loaded.

Is there way to just call a layout / render / paint function from the client?

function someAction()
{

addDivToDom( ‘some-known-id’ );
vaadin.somePaintFunction();

}

Thanks