[Lazarus] fixes_1_8 - DBLookupComboBox broken

Michael Thompson mike.cornflake at gmail.com
Thu Jan 11 03:05:05 CET 2018


On 11 January 2018 at 05:18, Werner Pamler via Lazarus <
lazarus at lists.lazarus-ide.org> wrote:

> Am 10.01.2018 um 21:57 schrieb Werner Pamler via Lazarus:
>
>> Am 10.01.2018 um 20:21 schrieb Gabor Boros via Lazarus:
>>
>>> I don't know. Attached a simple example. With it I can reproduce the
>>> problem on Windows too. So the problem is not Qt specific.
>>>
>>
>> You did not assign a Datasource to the DBLookupCombo. This is where the
>> value picked from the combo is stored to. Without a Datasource I consider
>> the present hehavior to be correct.
>>
>> Maybe another dev can comment who is more familiar with databases than me.
>>
>
I'm experiencing issues with this control as well.  I'm also not assigning
Datasource.  Not assigned Datasource is a valid use for this control, with
several Delphi and Lazarus examples out there, including on our wiki.
 Unbound use is used for keeping the active record in a dataset syncronised
with the contents of the DBLookupCombobox.

The code I'm using was derived from here:

http://wiki.freepascal.org/TDBLookupComboBox#Unbound_use

I've not investigated the code supplied by by Gabor Boros, but in my case
the combobox looks fine, until you change selection, then all entries in
the Combobox are cleared and no OnScroll is fired in the List Datasource.

For now I've worked around this by adding a Dummy TBufDataset.  I'm
pointing the DBLookupCombo.Datasource to the TBufDataset, and the datafield
to a variant field in TBufDataset.

This kind of works, though I'm now experiencing a random AccessViolation.
The code I've quickly inserted the TBufDataset workaround into is complex
(I'm cascading multiple DBLookupCombobox's, changing one affects all others
after it), and I inserted the TBufDataset workaround in a hurry.   For now,
I'm assuming the memory issue is mine.

I plan on looking at Gabor's code tonight, see if we're experiencing the
same issue.

Cheers

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180111/bb699477/attachment.html>


More information about the Lazarus mailing list