Subject Re: [IBO] OnClick Event not firing TIB_NavigationBar
Author Helen Borrie
At 07:57 AM 31/03/2003 +0200, you wrote:
>The following procedure has been assigned to the onclick event for
>TIB_NavigationBar1
>
>procedure TForm2.IB_NavigationBar1Click(Sender: TObject);
>begin
>If IB_QueryAnimal.FieldByName('AnimalStatus').AsString = '' then
> GroupBox1.Color := clBtnFace
>Else
> GroupBox1.Color := clBtnShadow;
>end;
>
>You can click to hearts content as you page through the database, and not
>once does the event fire.
>The on Before an After events do fire!

Ah, ok...

This isn't a VCL navbar. The IB_ one can receive announcements from and
become focused on *different* datasets, so it makes no sense to provide
events that only work with one dataset. Reserve the click event for things
affecting the control itself, such as blocking or permitting button actions
according to some flag in the app.

For this kind of behavioural response to data attributes, use a dataset
event, e.g. AfterScroll for your example. That's how native IBO
works: the data drives everything, including the controls.

cheers,
Helen