View Issue Details

IDProjectCategoryView StatusLast Update
0033160LazarusLCLpublic2018-08-28 11:47
ReporterGiovanni Seara Assigned Towp  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
OSWindows 
Product Version1.8 
Summary0033160: Selected item in TDBComboBox when TDataSet are browse
DescriptionIf TDataSet is navigated and the value of a TField is changed through a TDBComboBox, the state of the TDataSet changes to edit, but the value of the TField is not modified.

It has been identified that the problem is related to the RecordChange event and the TFielDataLink Reset method.
The problem is caused because when the UpdateData method of TFieldDataLink is called the variable IsModified is set to "False", so the value of the TField is not changed.

The temporary fix is to force the value of the IsModified variable to "True" when the Select method of the TDBComboBox is executed.
(...\lazarus\lcl\include\dbcombobox.inc - Line 60)

procedure TDBComboBox.Select;
begin
...
  FDataLink.OnDataChange := nil;
  try
    if FDataLink.Edit then
    begin
      if not FDataLink.IsModified then
        FDataLink.Modified;
      FDataLink.UpdateData;
...
end;
Steps To Reproduce1 - Stay the state of TDataSet in browse.
2 - Set the value of TField through the TDBComboBox.
3 - The state of TDataSet will be editing and the value of TField not will be modify.
TagsDbCtrls, lcl, TDBComboBox
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Relationships

related to 0032383 resolvedJesus Reyes TDbComboBox has problems to set data when item changes 
related to 0032463 closedwp Regression - TDBLookupComboBox raise exception 
related to 0030587 closedLuiz Americo TDBComboBox – field data is not updated if combo is not focused but element is changed by mouse wheel 
related to 0033164 resolvedJesus Reyes Start editing in DataSet through DBComboBox, application closes automatically 

Activities

Giovanni Seara

2018-02-12 16:00

reporter  

Bug TDBComboBox.zip (2,502 bytes)

wp

2018-02-12 18:06

developer   ~0106354

I can confirm on Laz 1.8, but not on Laz-trunk. The issue probably has been fixed for one of the reports mentioned in the relationships.

Can you test on trunk or 1.8-fixes (I am rather sure that the fix has been backported)

Giovanni Seara

2018-02-12 21:45

reporter   ~0106359

I tested with the 56884 revision and it was actually fixed.

wp

2018-02-12 22:11

developer   ~0106361

Resolving as "No change required". Please close.

Issue History

Date Modified Username Field Change
2018-02-12 16:00 Giovanni Seara New Issue
2018-02-12 16:00 Giovanni Seara File Added: Bug TDBComboBox.zip
2018-02-12 16:04 Giovanni Seara Tag Attached: DbCtrls
2018-02-12 16:04 Giovanni Seara Tag Attached: lcl
2018-02-12 16:04 Giovanni Seara Tag Attached: TDBComboBox
2018-02-12 17:51 wp Assigned To => wp
2018-02-12 17:51 wp Status new => assigned
2018-02-12 17:53 wp Relationship added related to 0032383
2018-02-12 17:57 wp Relationship added related to 0029595
2018-02-12 17:58 wp Relationship added related to 0032463
2018-02-12 17:58 wp Relationship deleted related to 0029595
2018-02-12 18:00 wp Relationship added related to 0030587
2018-02-12 18:06 wp Note Added: 0106354
2018-02-12 21:45 Giovanni Seara Note Added: 0106359
2018-02-12 22:11 wp LazTarget => -
2018-02-12 22:11 wp Note Added: 0106361
2018-02-12 22:11 wp Status assigned => resolved
2018-02-12 22:11 wp Resolution open => no change required
2018-02-19 20:07 Giovanni Seara Status resolved => closed
2018-08-28 11:47 wp Relationship added related to 0033164