ooBase Form Event Listener

Discuss the database features
Post Reply
SVCooper
Posts: 3
Joined: Tue Feb 25, 2020 12:36 pm

ooBase Form Event Listener

Post by SVCooper »

I want to create an event listener for an ooBase form in ooBasic, I THINK I have the bones of how to do it but don't know the specifics.

It seems to require 2 lines of code along the lines of:

objFormListener = CreateUnoListener("FormListener_","com.sun.star.somecomponent.XEventListener")
ThisComponent.com_sun_star_somecomponent_XEventBroadcaster_addEventListener(objFormListener)

And then an event handler such as:

Sub Sub FormListener_notifyEvent(objEvent As Object) MsgBox objEvent.EventName & " fired" End Sub 'FormListener_notifyEvent

I have been unable to find what "somecomponent" should be! (I have tried "form" and "forms") to no avail.

Can anyone help?
OpenOffice 4.16 on Windows 10
User avatar
robleyd
Moderator
Posts: 5384
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: ooBase Form Event Listener

Post by robleyd »

Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 25.2.4.3; SlackBuild for 25.2.4 by Eric Hameleers
---------------------
Roses are Red, Violets are Blue]
Unexpected '{' on line 32
.
User avatar
Villeroy
Volunteer
Posts: 31345
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: ooBase Form Event Listener

Post by Villeroy »

Any reason why you do not use the script events on the form's event tab?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
SVCooper
Posts: 3
Joined: Tue Feb 25, 2020 12:36 pm

Re: ooBase Form Event Listener

Post by SVCooper »

I'm trying to find out the sequence in which all events in my database will fire as an aid to building an application.

By using event listeners, I hope to save creating a handler for every single event. :(
OpenOffice 4.16 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31345
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: ooBase Form Event Listener

Post by Villeroy »

Forget it. This is not how Base works. This is not a database development suite.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
SVCooper
Posts: 3
Joined: Tue Feb 25, 2020 12:36 pm

Re: ooBase Form Event Listener

Post by SVCooper »

Hehe - that's like a red rag!!
OpenOffice 4.16 on Windows 10
Post Reply