Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread GetColumns / GetRows
Thu, Jul 26 2018 1:24 AMPermanent Link

Eivind

I recently updated to the latest build (Build 18) and run into some issues with code that worked a few builds back. I have implemented a client side filter function for my searchable comboboxes using a TDialogEditComboBox and I show the result in a grid dropped down below the combobox. All worked like a charm before I updated today. As I have  an active Transaction I have to create a new descendant of TDatabase to handle the filtering:

FilterDatabase := TDatabase.Create(Application);

Then I dynamically create a TDataSet and "clone" it from the complete dataset already loaded with data:

        With OMFilterDS do begin
           Close;
           LoadColumns(dmFX.taPersonnelLookup.GetColumns);
           Open;
           LoadRows(dmFX.taPersonnelLookup.GetRows);
           First;
        end;

So far so good. Then I do some filtering by deleting rows that does not match the search phrase. Again, all good so far. At the end I assign the result to a grid:

     gridDropDown.DataSet := OMFilterDS;
     gcSearchField.DataColumn := 'FULLNAME';

This gets repeated every time the user changes the search term and the search dataset is again populated and filtered. This all worked before.

After the update I get the following error: "Uncaught Error: Cannot read property 'tdataset_fstate' of null". This error gets thrown the second time (and consecutive times) the above code is executed. So it looks like GetColumns / GetRows throws this error when the dataset is bound to a grid. All this worked perfectly before without any error.

After alot of testing and troubleshooting I solved the problem by setting gridDropDown.DataSet := nil before I call GetColumns / GetRows again.

I can live with the fix I came up with by setting the DataSet property to nil and then setting it to the Filter Dataset. Just wondering if some core functionality had been change that I should know about

Thanks

Eivind
Fri, Jul 27 2018 4:06 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Eivind,


<< After the update I get the following error: "Uncaught Error: Cannot read property 'tdataset_fstate' of null". This error gets thrown the second time (and consecutive times) the above code is executed. So it looks like GetColumns / GetRows throws this error when the dataset is bound to a grid. All this worked perfectly before without any error. >>

Can you distill this down to an example project that replicates what you're seeing and send it to me ?

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Image