Icon View Incident Report

Serious Serious
Reported By: Kentersoft
Reported On: 11/30/2016
For: Version 2.05 Build 4
# 4469 OnRowChanged Not Firing When Row Values Updated in Response to Bound DataSet Preparing to Save Row

Sometime, TDataSet's OnRowChanged event not fired, see code below.

procedure TForm1.Form1Create(Sender: TObject);
begin
   Database.AutoTransactions := False;
   DataSet1.Open;
end;

procedure TForm1.DataSet1RowChanged(Sender: TObject; Column: TDataColumn);
var
   TempStr: String;
   Price: Double;
   Num: Integer;
   Ds: TDataSet;
begin
   LogOutput('OnRowChanged');
   if not Assigned(Column) then Exit;
   TempStr := Column.Name;
   Ds := TDataSet(Sender);
   if SameText(TempStr, 'price')or
      (SameText(TempStr, 'num')) then
   begin
      Price := Ds.Columns['price'].AsFloat;
      Num := Ds.Columns['num'].AsInteger;
      Ds.Columns['amount'].AsFloat := Price*Num;
   end;
end;



Comments Comments
The reason why the OnRowChanged event isn't firing is because EWB prevents recursive triggering of the data notification events. In this case, the TDataSet instance is asking the data-bound controls to update themselves via the cmUpdateRow notification event. Therefore, any updates to any data that occurs as a result will not trigger the OnRowChanged event. For most notifications, this is the desirable state. But, it just so happens that the cmUpdateRow notification cannot (directly) result in recursive data notification events, so it is safe to turn off the recursive check in such cases.


Resolution Resolution
Fixed Problem on 1/12/2017 in version 2.06 build 1


Products Affected Products Affected
Elevate Web Builder
Elevate Web Builder Trial

Image