Subject | Re: [IBO] Re: Recursive call of TIB_LookupCombo.OnChange |
---|---|
Author | Gabriel Juncu |
Post date | 2002-03-29T07:21:45Z |
Hi tibotaka,
Thank you for the solution, it works!
It is "far safer", I agree.
I can understand that the program is in OnChange event when it produces a
action that generates another OnChange event, and that may cause a recursive
call to the IBO internal procedures, but then why doing the same thing with a
TIB_Edit works? I have done what Calin Pirtea suggested (to assign a TIB_Edit
control to the same field in Qry as TIB_LookupCombo and to change the other field
values in the TIB_Edit.OnChange) and works ok.
Best Regards,
Gabriel
--------------------------------------------------------------------------------
Thursday, March 28, 2002, 6:17:42 PM, tibotaka wrote:
"LookupQry"->> IB_Dataset.FieldByName('SOME_FIELD').AsString;
Thank you for the solution, it works!
It is "far safer", I agree.
I can understand that the program is in OnChange event when it produces a
action that generates another OnChange event, and that may cause a recursive
call to the IBO internal procedures, but then why doing the same thing with a
TIB_Edit works? I have done what Calin Pirtea suggested (to assign a TIB_Edit
control to the same field in Qry as TIB_LookupCombo and to change the other field
values in the TIB_Edit.OnChange) and works ok.
Best Regards,
Gabriel
--------------------------------------------------------------------------------
Thursday, March 28, 2002, 6:17:42 PM, tibotaka wrote:
> In my opinion far better way to fill default values of "Qry""Qry"->> FieldByName('SOME_FIELD').AsString :=
> from "LookupQry" is in AfterScroll event of "LookupQry"...
> Code snippet:
> procedure Tfrm."LookupQry"AfterScroll(IB_Dataset: TIB_Dataset);
> begin
> inherited;
> with IB_Dataset.KeySource.DataSet do <- this is "Qry"
> begin
> case State of
> dssInsert,
> dssEdit:
> begin
"LookupQry"->> IB_Dataset.FieldByName('SOME_FIELD').AsString;
> ...etc...
> end;
> end;
> end;
> end;
> I think OnChange event of LookupCombo is "too dangerous and confused"
> for your needs... ;-)
> Sorry for a bit long post, but I hope it helps...
> Tibor