Personal tools
You are here: Home Forum Nice Office Access (NOA) replace a loaded document by another

 • replace a loaded document by another

Replies: 2   Views: 102
Up one level

 • replace a loaded document by another

Posted by jstaerk at 2010-01-02 19:44:34
Simple question: I have a officeFrame and loaded a text document (let's call it A) with , if the user clicks a button I want to save the changes to A and show B.

I save with textDocument1.getPersistenceService().store(URL);

and (due to the lack of sth like textDocumen1.load or textDocument1.open) currently I replace the document with textDocument1.getTextService().getText().setText("";); textDocument1.getViewCursorService().getViewCursor().getTextCursorFromStart().insertDocument(URL2);

which gives me a race condition, it often does not empty the complete text but creates a mixture of A andB.

Is there a way or a function I overlooked to quickly implement or use the functionality for sth like textDocumen1.load or textDocument1.open or something to wait until the save is finished or the new (empty) text is written?

thanks
Jochen
jstaerk Member
Posts: 52

 • Re: replace a loaded document by another

Posted by Markus Krueger at 2010-01-04 10:10:18
Hi Jochen,

it should already work using the attached snippet.

Regards,
Markus
Markus Krueger Manager
Posts: 507

 • Re: replace a loaded document by another

Posted by jstaerk at 2010-01-17 11:09:45
thanks a lot!
jstaerk Member
Posts: 52

Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: