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

Reply via email to