Subject Re: ParamName, was Re: [IBO] Programmatically grant role to user
Author Helen Borrie
At 09:38 PM 3/03/2006, you wrote:
>hello Helen,
>thanks for the clarification :-)
> > So, for the 'tr_type' parameter, I have a TIB_radiogroup that has
> > all the debit types as its items, that is bound to ParamName
> > tr_type, and for the two dates I have two tib_edits bound to
> > ParamName tr_date1 and tr_date2 respectively.
>so the trick is - taking your TIB_radiogroup as an example - to create
>an OnClick handler for the control and fill it with a TIB_Query.Refresh
> TIB_Query.Refresh

I suppose you could, but it's not what I do, since changing the
values in parameters is like a "deliberate" and optional
thing. Anyway, I'll often have multiple params, not just one. So I
have a small "Go" type of button for the user to click when she's
ready to change the filter parameters.

>This could be fine for this type of control, but what about a TIBEdit or
>similar control?

Actually, in a lot of circumstances, using the OnClick event of the
control isn't "fine" (at least IMO). It's too easy for the user to
do the wrong thing by mistake. As a user I prefer to feel that I'm in
control of what happens next and that's the way I write my apps, as well.

If you're using an updatebar, you could just let the user click the
Refresh button. If I have space, I'll use a small button or just a
speedbutton. I keep a "stock" collection of small bitmaps in a
TImagelist that I just paste into all my mainforms to put on
buttons. These days I'm likely to use speedbuttons as they are more compact.

>OnChange event? Doing this we would have a query refresh for every
>character typed. Not so good...
>OnExit event? The user may type characters without tabbing out of the
>control. Not so good...
>OnKeyPress event? Make the control responding to the Enter key so that
>you have to press Enter to refresh the query. Mmmmh...

Yes, KISS. :-)