TField oldValue / NewValue

In a follow up to a seminar someone asked about Tfields etc and specifically about old and new values.

Code on a button
   mmStatus.Lines.Insert(1,'Old: '+ string(WebClientDataSet1.FieldByName('_Category').OldValue));
   mmStatus.Lines.Insert(1,'New: '+ string(WebClientDataSet1.FieldByName('_Category').Newvalue));

I edit the field and tab to another field, but don't navigate away from the row, I get:
New: Triggerfis
Old: Triggerfis

i.e. old and new value are the same.  Is that as designed?


At this moment, the TDBField only will be updated from the DB control focus leave.

Thanks Bruno, but let me just check my understanding.  In a standard TField the oldvalue is the original value prior to the record being posted (I can't remember what happens with TClientDatasets and their cached updates).  The newValue will be set (as you say, when you leave the DBEdit).  So until the record is posted, you have access to oldValue, NewValue and also the datasets "modified" property, allowing you to decide how to deal with the record (e.g. have a post button).

We will check with the RTL developer