Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index


Hi all,

I run LibreOffice 6.0.2.1.0+ (Build-ID: 1:6.0.2-1~bpo9+1) on Debian stretch.  In a base document, 
connected to a PostgreSQL data base, I ran into a really confusing behaviour of forms.

The task: I have two forms.  In the first, when the user clicks a button, the second form (managing 
a list of contacts) shall be opened for entering a new item.  Following the manual, I wrote this 
macro and connected it to the “Execute action” of the button in the first form:

---8<----------------------------------------------------------------------------
Sub newContact
    oDstForm = thisDatabaseDocument.FormDocuments.getByName("Kontakte verwalten")
    oDstForm.open()
    oMainForm = oDstForm.component.getDrawPage.getForms.getByName("ContactForm")
    oMainForm.load()
    oMainForm.afterLast()
    oMainForm.moveToInsertRow()
End Sub
---8<----------------------------------------------------------------------------

This opens the form, but still displays the first entry, which should not happen.

Now for the /really/ puzzling part:  In the macro editor add a breakpoint at any statement in the 
macro.  Now step (shift-F8) through the remaining statements until “End Sub” is reached, and the 
form jumps to a new entry with all fields empty, i.e. does what I expect it to do.

When I place a ”wait 100” statement after “oDstForm.open()”, the form /also/ behaves properly, but 
I think this is not the correct solution.  Any idea what goes wrong at this point, and what would 
be the correct approach?

Thanks in advance,
Albrecht.
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.