Re: [dba-dev] Opening a GridControl in a UNO Dialog

2009-10-05 Thread Frank Schoenheit, Sun Microsystems Germany
Hi Fernand,

> Thanks to what i learned from Frank and Ariel i can open a 
> DataSourceBrowser in a UNO Dialog doing the same for a FormGridView 
> fails in a way that the FormGridView opens in the dialog but without data ?

The FormGridView is meant as "slave" view for an existing and living
form, it's the component you see when pressing the "Form as Table"
button in a form document. So, it won't work on its own.

I don't know out of my head how you would need to create a proper env
for the FormGridView, but can we go one step back, and you explain what
you want to achieve? Depending on this, the FormGridView might not be
the best choice.

Ciao
Frank

-- 
- 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...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org



[dba-dev] Opening a GridControl in a UNO Dialog

2009-10-05 Thread Fernand Vanrie

Hallo all,

Thanks to what i learned from Frank and Ariel i can open a 
DataSourceBrowser in a UNO Dialog doing the same for a FormGridView 
fails in a way that the FormGridView opens in the dialog but without data ?


Wath I am doing is loading a ".component:DB/FormGridView" in a UNO 
Dialog ControlFrame using the same mediadescriptor (LoaderArguments) as 
for the DataSource Browser, wath are I missing??


the code based on the work of Ariel Constenla-Haile

Sub DataSourceBrowser_FrameControl

   Dim oDlg as Object, oGhost as Object, oFrameControl as Object
   Dim aPosSize
   Dim oFrame as Object, oController as Object, oModel as Object
  
   DialogLibraries.loadLibrary("Standard")
  
   oDlg = 
createUnoDialog(DialogLibraries.Standard.DBTABLEPREVIEWDIALOG) ' dialog 
with a Frame_control init namend  "WIN_BEAMER
  
   oGhost = oDlg.getControl("WIN_BEAMER")

   aPosSize = oGhost.getPosSize()
  
   oFrameControl = createUnoService("com.sun.star.frame.FrameControl")


   oDlg.addControl("FRAME_CTRL", oFrameControl)
   oFrameControl.setPosSize(aPosSize.X, aPosSize.Y, aPosSize.Width, 
aPosSize.Height, _

   com.sun.star.awt.PosSize.POSSIZE)
  
   Dim aLoaderArguments(5) as New com.sun.star.beans.PropertyValue

   aLoaderArguments(0).Name = "DataSourceName"
   aLoaderArguments(0).Value = "MyRegisteredDatabase"
   aLoaderArguments(1).Name = "CommandType"
   aLoaderArguments(1).Value = com.sun.star.sdb.CommandType.TABLE
   aLoaderArguments(2).Name = "Command"
   aLoaderArguments(2).Value = "My_table"
  
   aLoaderArguments(3).Name = "ShowTreeView"

   aLoaderArguments(3).Value = FALSE
   aLoaderArguments(4).Name = "ShowTreeViewButton"
   aLoaderArguments(4).Value = FALSE
   aLoaderArguments(5).Name = "ShowMenu"
   aLoaderArguments(5).Value = FALSE
  
   'This property is not documented in the IDL
   
'http://api.openoffice.org/docs/common/ref/com/sun/star/frame/FrameControl.html

   oFrameControl.LoaderArguments = aLoaderArguments
  
'oFrameControl.ComponentUrl = ".component:DB/DataSourceBrowser"

oFrameControl.ComponentUrl = ".component:DB/FormGridView"
   oFrame = oFrameControl.Frame
   If NOT IsNull(oFrame) Then
   oController = oFrame.Controller
   If NOT IsNull(oController) Then
   oModel = oController.Model
   If NOT IsNull(oModel) Then'here is NULL: the DSB has no model
   '...
   End If
   End If
   End If
 
End Sub


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