Hello Ferry, please note I answer your mail in [email protected], our project's maling list. Using this list scales much better than private mails, so please also answer there [1]. Thanks.
> Sorry for contacting you directly, but I'm searching for an answer to a > related problem and you seem to be the person with the answers. > > Simplified example: > > > I have a table with entries (OpenOffice Base 2.1, jdbc to postgresql > bridge) with one column called EntryDate. > > I want to have a form that limits the entries based on the date. > This is probably a common task. > > The forms query should be something like: > > select * from EntryTable with EntryDate > :StartDate and EntryDate < > :EndDate > > Initially Base doesn't recognize the named parameters. > > Using http://dba.openoffice.org/howto/param_subst.html, running the > forms query prompts a dialog box for the parameters StartDate and EndDate. (Note that nowadays there's an UI for this in the Advanced Settings of the database. Look in the Edit/Database menu.) > But what I want to do is have the _data in the controls named StartDate > and EndDate to_ be substituted. According to the documentation I need > to register the controls as parameter listeners. > > But how do I do this, using Basic? You cannot register the controls themselves. You can create a listener in Basic (createUnoListener), and register this listener at the form. This would need to happen in the OnLoad event of the whole document. In the listener method, you could then read the values from the controls, and fill them into the proper parameters. Note, however, that parameter listeners are only called when the form is loaded or reloaded. I am not sure whether you want the content of your form to follow the control content. That is, as soon as you type new values, the form would be restricted to these new dates. If so, you'd additionally need to add ModifyListeners to the controls, and reload the form as soon as the control values change. > Feature request: Shouldn't these unbound controls be registered > automatically as parameter listeners? What else would they be good for? Well, there are quite some other use cases except holding parameter values, but I agree that it would be nice to be able to *declare* a control as holding a parameter value. Somewhat related, and probably would also solve your problem: I'd like to have the ability to declare a control as "Filter control". Everything you type in there would be used to filter the respective form in (nearly) real time ... > Thanks in advance for your time. I'll try to make an effort to publish > the solution on a Wiki when solved. Thanks. Ciao Frank [1] http://wiki.services.openoffice.org/wiki/Base_Mailing_List --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
