Forum > Databases

[SOLVED] TDBLookupCombobox, OnChange event didn't triggered

(1/1)

incendio:
Hi guys,

I am using IBX on Lazarus 2.0.12 on Windows 10 with Firebird 3 database.

I have a TDBLookupCombobox in my form, listsource, listfield, and keyfield point to a TIBQuery.

The app runs OK, but there are something strange with TDBLookupCombobox. I can changed its value, but the OnChange Event didn't triggered.

I also have a button with this code

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TRptIntFrm.PreviewBtnClick(Sender: TObject);begin  ShowMessage(QRptRPTNM.AsString);end; 
When clicked after changed combobox value, Showmessage always return the first record value of QRpt.

Any idea how to correct this?

Thanks in advace.

GAN:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---I have a TDBLookupCombobox in my form, listsource, listfield, and keyfield point to a TIBQuery.
Do the same with DataField and DataSource.

incendio:

--- Quote from: GAN on April 12, 2022, 06:02:37 am ---
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---I have a TDBLookupCombobox in my form, listsource, listfield, and keyfield point to a TIBQuery.
Do the same with DataField and DataSource.

--- End quote ---
On Combobox, I don't think set ListSource and Datasource to the same dataset is a good idea.

Although it could triggered OnChange event, but it was only work with TSQLQuery, not worked with IBX, also, this way, even the property ScrollistDataset set to true, Dataset not scrolled.

I think this is a bug.

incendio:
Found a solution, didn't use OnChange event, instead, used OnSelect Event, seem to get the job done.

Thanks everyone.

Navigation

[0] Message Index

Go to full version