[dba-dev] Re: How to refresh DataSourceBrowser in a FrameControl

2011-06-13 Thread Frank Schönheit
Hi Fernand,

 I am afraid that the parameter stuff is not working at all
 
 oForm.setint(1,1000) should gives a value of 1000 to parameter 1
 
 but this does nothing, the oform.parameters stay empty ?

Hmm, this might be caused by some special implementation, seems to be
some inconsistency here, indeed.

 and SQL is 
 complaining about missing parameter value's

Well - parameters are the means by which sub forms are implemented, so I
am pretty sure they work in general. Not sure which concrete commands
cause the problem in your scenario :-\

 But passing a new command an reloading works like a charm... so we uses 
 this workaround sucesfuly

Fine :)

Ciao
Frank
-- 
-
To unsubscribe send email to dev-unsubscr...@dba.openoffice.org
For additional commands send email to sy...@dba.openoffice.org
with Subject: help


[dba-dev] Re: How to refresh DataSourceBrowser in a FrameControl

2011-06-09 Thread Frank Schönheit
Hi Fernand,

 Point is : my Datsourcebrowser has no model ?

Ah ... the pitfalls of the Basic UNO binding!

The controller supports both the XController and XTabController
interfaces, both have a getModel() method, so oController.getModel()
(or oController.Model) is ambiguous in Basic. It is not defined (to my
knowledge) to which of the methods this is resolved - seems to be
XController.getModel(), which indeed returns NULL - which is expected,
since the DataSourceBrowser does not have an associated document (which
would be the XModel returned by XController.getModel()).

Basic's syntax to access a method *with* specifying the interface it is
defined at is
  oDataSourceBrowser.com_sun_star_awt_XTabController_getModel()

Ciao
Frank
-- 
-
To unsubscribe send email to dev-unsubscr...@dba.openoffice.org
For additional commands send email to sy...@dba.openoffice.org
with Subject: help


[dba-dev] Re: How to refresh DataSourceBrowser in a FrameControl

2011-06-09 Thread Fernand Vanrie

Frank ,

Me again:
when loading a paramerized statement i have aSQL error Values not set 
for all parameters

so i load
  aLoaderArguments(1).Name = CommandType
aLoaderArguments(1).Value = 2 'com.sun.star.sdb.CommandType.TABLE
aLoaderArguments(2).Name = Command
   aLoaderArguments(2).Value = SELECT distinct *   FROM  
pmgdbase.adv_reden_tbvips  WHERE pmgdbase.adv_reden_tbvips.REDENID = ? 


how do i can load mi ? parametervalue
i supose something like
aLoaderArguments(6).Name = CommandParameter 1 ???
aLoaderArguments(6).value = sID

Grzt

Fernand


Hi Fernand,


Thanks, now i have my Model and can reload, but the reloading do not
affects the activecommand ? an not the results

So how to make the new Loaderarguments (active) or how to pass a new
activecommand to the DatasourceBrowser

Ah - I missed, in your original mail, that you actually want to change
the command underlying the DSB.

The simplest way might be to just set the Command property of the
database form (the model you just retrieved) before reloading.

A slightly more complex, but cheaper (in terms of runtime resources)
solution would be to base the DSB on a parametrized statement (...
WHERE REDENID = ?), and then use the XParameters.setInt (or whatever
type the REDENID column has) method:
   oForm = oController.com_sun_star_awt_XTabController_getModel()
   oForm.setInt( 1, sid )
   oForm.reload()


my code is now:

   odlg.getcontrol(Grid2).LoaderArguments = aLoaderArguments2 ' the new
arguments with a new SQL statement in it

The LoaderArguments are used at the time the DSB is plugged into the
frame, and then discarded (at least as far as the DSB is concerned, not
sure the FrameControl implementation makes later use of it). Thus,
reload does know nothing 'bout changed LoaderArguments, so this doesn't
work.


   oDatasourceBrowser = odlg.getcontrol(Grid2).frame.controller
   omodel = oDatasourceBrowser.com_sun_star_awt_XTabController_getModel()
   omodel.reload

As said above,
   oModel.Command =new_command
before doing the reload should help already.

Ciao
Frank


--
-
To unsubscribe send email to dev-unsubscr...@dba.openoffice.org
For additional commands send email to sy...@dba.openoffice.org
with Subject: help


[dba-dev] Re: How to refresh DataSourceBrowser in a FrameControl

2011-06-08 Thread Frank Schönheit
Hello Fernand,

 I try to use the com.sun.star.frame.FrameControl in a dialog acting as
 a subforms'.
 
 So i have 2 Framecontrol's  loaded with a dataSource browser based on a
 SQL-statement
 
 When selecting a row in the first FrameControl the data in the second
 must been refreshed (passing a new SQL-statementto the second Framecontrol).
 
 I found no way to do that because the activeCommand off the Resultset is
 readonly.

The DataSourceBrowser supports the css.form.FormController service, thus
a css.form.XFormController interface, so the getModel method will return
the css.form.component.DataForm which represents the data. This, in
turn, has a css.form.XLoadable interface, which supports a reload method.

So, something like

  oDataSourceBrowser.getModel().reload()

should do (assuming that oDataSourceBrowser is the controller loaded
into your Grid2 control).

Ciao
Frank
-- 
-
To unsubscribe send email to dev-unsubscr...@dba.openoffice.org
For additional commands send email to sy...@dba.openoffice.org
with Subject: help


[dba-dev] Re: How to refresh DataSourceBrowser in a FrameControl

2011-06-08 Thread Fernand Vanrie

Hallo Frank ,

Point is : my Datsourcebrowser has no model ?

I load a DatsourceBrowser in a FrameControl (learned from Ariel) in a Dialog

oFrameControl2 = createUnoService(com.sun.star.frame.FrameControl)
oDlg.addControl(Grid2 oFrameControl2)

Then Grid2 (in my Dialog)  is  a com.sun.star.frame.FrameControl 
with no model but a Frame  who has a Controler  who is a 
DatasourceBrowser but with no Model !


so i am a bit confused :-)

Thanks

Fernand

Hello Fernand,


I try to use the com.sun.star.frame.FrameControl in a dialog acting as
a subforms'.

So i have 2 Framecontrol's  loaded with a dataSource browser based on a
SQL-statement

When selecting a row in the first FrameControl the data in the second
must been refreshed (passing a new SQL-statementto the second Framecontrol).

I found no way to do that because the activeCommand off the Resultset is
readonly.

The DataSourceBrowser supports the css.form.FormController service, thus
a css.form.XFormController interface, so the getModel method will return
the css.form.component.DataForm which represents the data. This, in
turn, has a css.form.XLoadable interface, which supports a reload method.

So, something like

   oDataSourceBrowser.getModel().reload()

should do (assuming that oDataSourceBrowser is the controller loaded
into your Grid2 control).

Ciao
Frank


--
-
To unsubscribe send email to dev-unsubscr...@dba.openoffice.org
For additional commands send email to sy...@dba.openoffice.org
with Subject: help