View Issue Details

IDProjectCategoryView StatusLast Update
0033800LazarusLCLpublic2018-10-05 10:03
Reporteruser5256Assigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformCocoaOSMac OS X OS VersionSiera
Product VersionProduct BuildTrunk 
Target Version1.10Fixed in Version1.9 (SVN) 
Summary0033800: Dataset enter in "Edit" mode if there is a DBLookupComboBox
DescriptionIf there is a DBLookupComboBox, placed on a form which is related to main dataset field and lookup data set field, when the maindataset is opened or scrolled , it goes to "Edit" mode, which is not expected.
After some analysts, I found, that the reason is because cocoa widget fires "OnSelectected" event into CustomComboBox, which triggers "FDatalink.Edit" method.
In fact, there is selection change, because when main dataset "changes" combobox text (because of open or scroll), but it is not user change, and must not fire "OnSelected" event.
Steps To ReproduceCreate a simple project with a two MemoryDataSet Components. Name one of that "MainDs", another one - "LookupDs". Add in MainDs field called "ID", into lookupDs- two fields - L_ID and L_STRING(255).
Put two datasources on the form, ling them to the datasets.
Place some DBGrid on form (just for watching) and link it to the datasource related to MainDs.
Place a DBLookupComboBox control and set the properties: Datasource to the MainDs datasource, LookupSource to the LookupDS datasource. SetDataField to field ID from MainDS, KeyField to L_ID and ListField to L_STRING.
Add the following code on "FormCreate" event:
  LookupDs.CreateTable;
  LookupDs.Open;

  MainDs.CreateTable;
  MainDs.Open;

  MAinDs.Append;
  MAinDs.FieldByName('ID').Value := 1;
  MAinDs.Post;
  MAinDs.Append;
  MAinDs.FieldByName('ID').Value := 2;
  MAinDs.Post;


  LookupDs.Append;
  LookupDs.FieldByName('L_ID').Value := 1;
  LookupDs.FieldByName('L_STRING').Value := 'String 1';
  LookupDs.Post;
  LookupDs.Append;
  LookupDs.FieldByName('L_ID').Value := 2;
  LookupDs.FieldByName('L_STRING').Value := 'String 2';
  LookupDs.Post;

Compile and start the App. You will immediately see that the DBGrid is into "Edit" mode.
Scroll the cursor to the second DBGrid row and again maindataset will be into Edit mode.


I tested the same project under Windows, Ubuntu (GTK2), OS X (Carbon) and there is no problem.
Additional InformationPlease find attached simple test project.
TagsNo tags attached.
Fixed in Revision59252
LazTarget1.10
WidgetsetCocoa
Attached Files

Activities

user5256

2018-05-29 08:49

 

testproject.7z (61,898 bytes)

Jesus Reyes

2018-10-05 10:03

developer   ~0111254

please test

Issue History

Date Modified Username Field Change
2018-05-29 08:49 user5256 New Issue
2018-05-29 08:49 user5256 File Added: testproject.7z
2018-09-12 17:31 Jesus Reyes Assigned To => Jesus Reyes
2018-09-12 17:31 Jesus Reyes Status new => assigned
2018-10-05 10:03 Jesus Reyes Fixed in Revision => 59252
2018-10-05 10:03 Jesus Reyes LazTarget => 1.10
2018-10-05 10:03 Jesus Reyes Note Added: 0111254
2018-10-05 10:03 Jesus Reyes Status assigned => resolved
2018-10-05 10:03 Jesus Reyes Fixed in Version => 1.9 (SVN)
2018-10-05 10:03 Jesus Reyes Resolution open => fixed
2018-10-05 10:03 Jesus Reyes Target Version => 1.10