loader.loadComponentFromURL(newURL, _BLANK, 0, impl_getDefaultLoadArgs()));
final int previousOnLoadEventPos = impl_waitForEvent(m_globalEvents, "OnLoad", 5000);
// ... and another document ...
final String otherURL = copyToTempFile(databaseDoc.getURL());
final XModel otherDoc = (XModel) UnoRuntime.queryInterface(XModel.class,
loader.loadComponentFromURL(otherURL, _BLANK, 0, impl_getDefaultLoadArgs()));
impl_waitForEvent(m_globalEvents, "OnLoad", 5000, previousOnLoadEventPos + 1);
impl_raise(otherDoc);
// ... and switch between the two
impl_startObservingEvents(context);