Am Donnerstag, den 25.05.2006, 23:17 +0200 schrieb Mathias Bauer: > Marc Santhoff wrote: > > > Hi, > > > > I'm asking myself if it is possible to start implementing the following > > scenario: > > > > A doc is opened in a frame (and window). On a command of the user the > > component attached to the frame is stored elsewhere to keep the > > reference and a second document (component) is loaded into that frame. > > After a task is done by the user the second component get's saved and > > destroyed and the first component is attached to the frame again. > > > > The goal is to reuse the window presented to the user with variing > > contents. > > > > Will this work or am I asking for trouble regarding attached listeners, > > dispatch or whatelse? > > A "component" inside a frame comprises a controller and a model. You can > not keep the controller without the frame, but you can keep the model > and you can use this model later on to recreate a controller including a > view from it without reloading the document.
Yes, that's what I wanted to ask for (not fully tuned to thinking UNO atm ;). > To preserve the model from being closed when its last controller gets > destroyed you must register as a close listener at it and deny its > request for becoming closed. Okay. > The recreation of the view is a little bit tricky because the necessary > API currently does not exist (it's in the making though). As far as it works, it's okay with me. :) Do you know an issue number for watching progress on this topic? > We ourselves use the following replacement: > use the loadComponentFromURL() method of the desired frame, but pass a > parameter "Model" in the MediaDescriptor that contains a reference to > the model. This will advise the frame loader to use the existing model > and not creating and loading a new one. You must provide the valid URL > of the document though (or the stream it was loaded from) to pass the > type detection and to avoid confusion in the documents' internal media > descriptor. I'll try that, I remeber seeing this solution in another thread recently. Thank you very much, Marc --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
