Hi Paolo,

> Regarding the ThisDatabaseDocument thing, I'm experimenting.
> 
> The open() method is very simple and straightforward and I'm sure that 
> users will be very happy of it, but I noticed a possible problem.

Not sure which open method you refer to, ThisDatabaseDocument doesn't
have one.

> The open method seems not able to create the first connection. This 
> means that you can use the open method only for the second form, but you 
> still have to launch manually a first form.
> 
> This makes impossible to use the open() method in order to launch a form 
> from the OnOpen method for example.

If you want to open a form (in the sense of: display UI) when the
document loads, you should use methods at the *controller* of the
document, not at the document. For this, XDatabaseDocumentUI [1] should
be used. It provides functionality which effectively mimics user input.

So, something like
  oController = ThisDatabaseDocument.CurrentController
  If ( Not oController.isConnected() ) Then
    oController.connect()
  End If
  oController.loadComponent( "my form", _
    com.sun.star.sdb.application.DatabaseObject.FORM,
    FALSE  ' not for editing, but for data entry
  )
should do what you want.

Ciao
Frank

[1]http://api.openoffice.org/docs/common/ref/com/sun/star/sdb/application/XDatabaseDocumentUI.html



-- 
- Frank Schönheit, Software Engineer         frank.schoenh...@sun.com -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Base                       http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to