View Issue Details

IDProjectCategoryView StatusLast Update
0025754LazarusLCLpublic2015-05-29 20:48
ReporterErwin van den BoschAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.0.15 (SVN)Product Build43718 
Target Version1.4.2Fixed in Version1.5 (SVN) 
Summary0025754: TDBRadioGroup value not set when not in editmode
DescriptionIf you click on a TDBRadioGroup the dataset goes into Edit mode but the value is not changed. After clicking a second time on the TDBRadioGroup the value is set.
Additional InformationFix: patch included
TagsNo tags attached.
Fixed in Revision49214
LazTarget1.4.2
WidgetsetWin32/Win64
Attached Files
  • dbradiogroup.inc.patch (956 bytes)
    Index: lcl/include/dbradiogroup.inc
    ===================================================================
    --- lcl/include/dbradiogroup.inc	(revision 43989)
    +++ lcl/include/dbradiogroup.inc	(working copy)
    @@ -132,16 +132,19 @@
     procedure TDBRadioGroup.UpdateRadioButtonStates;
     var
       OldValue: String;
    +  NewValue: String;
       SettingValue: boolean;
     begin
       OldValue:=Value;
       inherited UpdateRadioButtonStates;
       SettingValue := FInSetValue;
    -  Value := GetButtonValue(ItemIndex);
    -  if (Value<>OldValue) and FDatalink.CanModify and not SettingValue then
    +  NewValue := GetButtonValue(ItemIndex);
    +  if (NewValue<>OldValue) and FDatalink.CanModify and not SettingValue then
       begin
    -    if FDatalink.Edit then  // ensure that we are in edit state
    -      FDataLink.Modified
    +    if FDatalink.Edit then begin // ensure that we are in edit state
    +      FDataLink.Modified;
    +      Value := NewValue;
    +    end
         else
           DataChange(Self);
       end;
    

Activities

Erwin van den Bosch

2014-02-21 15:56

reporter  

dbradiogroup.inc.patch (956 bytes)
Index: lcl/include/dbradiogroup.inc
===================================================================
--- lcl/include/dbradiogroup.inc	(revision 43989)
+++ lcl/include/dbradiogroup.inc	(working copy)
@@ -132,16 +132,19 @@
 procedure TDBRadioGroup.UpdateRadioButtonStates;
 var
   OldValue: String;
+  NewValue: String;
   SettingValue: boolean;
 begin
   OldValue:=Value;
   inherited UpdateRadioButtonStates;
   SettingValue := FInSetValue;
-  Value := GetButtonValue(ItemIndex);
-  if (Value<>OldValue) and FDatalink.CanModify and not SettingValue then
+  NewValue := GetButtonValue(ItemIndex);
+  if (NewValue<>OldValue) and FDatalink.CanModify and not SettingValue then
   begin
-    if FDatalink.Edit then  // ensure that we are in edit state
-      FDataLink.Modified
+    if FDatalink.Edit then begin // ensure that we are in edit state
+      FDataLink.Modified;
+      Value := NewValue;
+    end
     else
       DataChange(Self);
   end;

Erwin van den Bosch

2015-04-30 21:50

reporter   ~0083355

Is anyone doing something with this problem/fix?
Who is the maintainer of the dbcontrols?

Jesus Reyes

2015-05-29 20:48

developer   ~0084110

Applied, thank you.

Issue History

Date Modified Username Field Change
2014-02-21 15:55 Erwin van den Bosch New Issue
2014-02-21 15:56 Erwin van den Bosch File Added: dbradiogroup.inc.patch
2015-04-30 21:50 Erwin van den Bosch Note Added: 0083355
2015-04-30 23:43 Maxim Ganetsky Assigned To => Jesus Reyes
2015-04-30 23:43 Maxim Ganetsky Status new => assigned
2015-05-29 20:48 Jesus Reyes Fixed in Revision => 49214
2015-05-29 20:48 Jesus Reyes LazTarget => 1.4.2
2015-05-29 20:48 Jesus Reyes Note Added: 0084110
2015-05-29 20:48 Jesus Reyes Status assigned => resolved
2015-05-29 20:48 Jesus Reyes Fixed in Version => 1.5 (SVN)
2015-05-29 20:48 Jesus Reyes Resolution open => fixed
2015-05-29 20:48 Jesus Reyes Target Version => 1.4.2