WPCubed Product Support

Unwanted editmode

Hi again,

i have:
a TDBWPRichText
a TWPMMDataProvider connected to the TDBWPRichText

when i set the TWPMMDataProvider.DataSource, the DataSet of the TDBWPRichText goes into edit-mode. How do i prevent this from happening? I want to change between showing the fieldnames and showing the merged data without going into editmode.

greetings,
Wolfgang

#1 ♥ 0
5.2k Views 2 users read 2 min
support

Hi,

Don't use a DBWPRichText in this case.

Simply use a TWPRichText and in the OnScroll event of the TDataSet do a

WPRichText1.AsString := SomeField.AsString.

You can also set Readonly to true.

Julian

#2 ♥ 0

Thanks Julian,

i thought of doing it this way but i want to avoid another big wp-component ;-)

what do you think of this solution:
when creating the components i set

WPMMDataProvider.AutoLoadData   := False;

before switching between fields and merged data i do:

WPMMDataProvider.AutoLoadData := (DataSource.DataSet.State in [dsEdit, dsInsert]);

meaning that when the user edited something or went into edit-mode with the navigator, he will see correct merged data.

Would this be nonsense in your wp-perspective or is it a legal use of your component?

Best wishes,
Wolfgang

#3 ♥ 0
support

Hi,

If I understand correctly YOu can do this correctly. But You will need do issue a MergeText('') in the DataSet StateChange event.

Of course the DB and DataProvider way is "legal" - but on the other hand the code required to do it "manuall" is so little and easy, that I woulkd rather add the required event handler.

Julian

#4 ♥ 0
This category is archived. No new posts are possible.