TDBRichViewEdit - updating record without calling .post

General TRichView support forum. Please post your questions here
Post Reply
stuartclennett
Posts: 13
Joined: Wed Oct 22, 2014 9:37 am
Location: UK

TDBRichViewEdit - updating record without calling .post

Post 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
Sergey Tkachenko
Site Admin
Posts: 17564
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Why don't you want to call dataset.Post?
stuartclennett
Posts: 13
Joined: Wed Oct 22, 2014 9:37 am
Location: UK

Post 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
Sergey Tkachenko
Site Admin
Posts: 17564
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Call dataset.UpdateRecord
stuartclennett
Posts: 13
Joined: Wed Oct 22, 2014 9:37 am
Location: UK

Post by stuartclennett »

Thank you, I hadn't realised that TDataset.UpdateRecord was public :)
Post Reply