Subject Re: [IBO] When does TIB_Checkbox store its data?
Author Lukas Zeller
Hi Jason,

thanks for the tip:

At 9:18 AM -0700 16.12.2000, you, Jason Wharton wrote:
>In the OnClick event call the datasource's UpdateRecord method.
I assume it's the dataSet's UpdateRecord? TIB_DataSource has no
such method.

Now I got it to work, but I do not understand exactly when
OnDataChange is triggered and when OnUpdateData is triggered.
I need to perform my updates in both events, or otherwise
the first click into the checkbox will still fail to cause
the updates.

Second thing I don't really understand: I tried to get the current
value of the checkbox by querying the connected field:


MyIBEdit.enabled:=dsMyDataSource.DataSet.FieldByName('MYBOOLEAN').AsInteger>0;
// I use SMALLINT booleans, 0=false, 1=true

This does not work, I guess because OnUpdateData/OnDataChange are
triggered before the field is actually updated?

I need to query the checkbox itself in order to make it work:

MyIBEdit.enabled:=MyIB_CheckBox.checked;

This way, and when the above statement is in both OnDataChange AND
OnUpdateData, it works.

Regards, Lukas

Lukas Zeller (luz@...), Direktwahl +41 1 440 66 01
--
Synthesis AG, Rosengartenstr. 1a, 8037 Zürich
Tel: +41 1 440 66 00, Fax: +41 1 440 66 04
info@..., http://www.synthesis.ch