URL setting to open Form from a button

Creating and using forms

URL setting to open Form from a button

Postby charlie.it » Sat Mar 28, 2020 5:32 pm

Ciao to all.
I know I can assign the Opendocument / web page action to the Action property of a button.
I also know that if I set the URL ".uno: CloseWin", clicking the button will close the form window.
Is there a URL setting that opens another form to me without having to resort to a macro?
Thank you.
charlie
macOS 10.12 Sierra: Open Office 4.1.7 - LibreOffice 6.2.8

http://www.charlieopenoffice.altervista.org
User avatar
charlie.it
Volunteer
 
Posts: 333
Joined: Wed Aug 21, 2013 2:12 pm
Location: Italy

Re: URL setting to open Form from a button

Postby RoryOF » Sat Mar 28, 2020 5:38 pm

Why not select two button actions - button down closes form, button up opens new form?
Apache OpenOffice 4.1.7 on Xubuntu 18.04.4 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 30933
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: URL setting to open Form from a button

Postby Villeroy » Sat Mar 28, 2020 5:48 pm

Save the forms as stand-alone Writer documents. Then you can open them with plain file: URL hyperlinks or hyperlink buttons.
Embedded forms always require a macro like this one:
Code: Select all   Expand viewCollapse view
Sub OpenEmbedded(odb, sHierachicalName$, bReport As Boolean)
   view = odb.CurrentController
   con = view.ActiveConnection
   if isNull(con) then view.connect()
   if bReport then
      container = odb.ReportDocuments
   else   
      container = odb.FormDocuments
   endif
   obj = container.getByHierarchicalName(sHierachicalName)
   obj.open()
End Sub

The above macro handles forms and reports by hierarchical names including any folder names.
For instance:
Code: Select all   Expand viewCollapse view
Sub OpenTaxForm()
GlobalScope.BasicLibraries.loadLibrary("DBA")
OpenEmbedded ThisDatabaseDocuent, "Setup/TaxForm", False
End Sub

ThisDatabaseDocument is the odb embedding the macro and the form, the second argument refers to "TaxForm" in subfolder "Setup", Third argument is False and True when loading a report.
"DBA" (database access) is the name of a library in "MyMacros" where the generic macro is stored.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28220
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: URL setting to open Form from a button

Postby charlie.it » Sat Mar 28, 2020 6:32 pm

RoryOF wrote:Why not select two button actions - button down closes form, button up opens new form?

That's what I was asking, if there is a ".uno: xxxx" to open another existing form, but Villeroy says no.

Villeroy wrote:Save the forms as stand-alone Writer documents. Then you can open them with plain file: URL hyperlinks or hyperlink buttons

I Knew it, thanks.
Villeroy wrote:Embedded forms always require a macro

I hoped not, thanks.
charlie
macOS 10.12 Sierra: Open Office 4.1.7 - LibreOffice 6.2.8

http://www.charlieopenoffice.altervista.org
User avatar
charlie.it
Volunteer
 
Posts: 333
Joined: Wed Aug 21, 2013 2:12 pm
Location: Italy


Return to Forms

Who is online

Users browsing this forum: No registered users and 2 guests