Page 1 of 1

TDBRichViewEdit - updating record without calling .post

Posted: Tue Nov 04, 2014 2:23 pm
by stuartclennett
Hi,

I have a TDBRichViewEdit on a modal form. Its used for more advanced editing features -- there is a smaller TDBRichView on the main editing form.

When the user has finished editing on the modal form, the form is just closed (i.e. Dataset.Post is not called as I don't want to affect other fields).

The problem is that the record isn't updated with changes to the TDBRichViewEdit unless it first loses focus.

I tried calling TDBRichViewEdit.'Update', 'Change' and even 'Format' in FormClose or FormCloseQuery, but it didn't have the desired effect.

I have worked around this by adding cmbFontSize.SetFocus in the FormCloseQuery event, which forces the change of focus.

I wondered is there a specific method to force update the record?


Thanks

Posted: Tue Nov 04, 2014 4:41 pm
by Sergey Tkachenko
Why don't you want to call dataset.Post?

Posted: Tue Nov 04, 2014 5:34 pm
by stuartclennett
Mostly because the modal form is not the main editing form -- and on the main editing form there is Save & Cancel buttons which do the post/cancel stuff.

There is more to the record than just the document, so I have to give them opportunity to cancel the edits., which I can't do if the modal RVF editor has just called post.

Cheers

Posted: Tue Nov 04, 2014 7:27 pm
by Sergey Tkachenko
Call dataset.UpdateRecord

Posted: Wed Nov 05, 2014 9:58 am
by stuartclennett
Thank you, I hadn't realised that TDataset.UpdateRecord was public :)