1. Bill Asby
  2. PowerBuilder
  3. Friday, 7 September 2018 15:57 PM UTC

Hello,

I have inherited a PowerBuilder application. Apologies and condolences accepted. lol. It was migrated from PB12.6 to PB2017 recently.

I am working on a screen that uses an RTE control. I am trying to detect whether or not the RTE contents has changed. When I am testing, for some reason unknown to me, the Modified indicator is falsely indicating that the RTE contents changed even though I did nothing to change them.

I noticed that the existing code uses rte_1.copyRTF() and rte_1.PasteRTF() to initialize the RTE with data from the DW and to write it back before a save. I am guessing that this might be what is setting the modified flag.

Does anybody have any good examples of how to detect when the contents of an RTE truly has changed?

Thanks

Bill

Roland Smith Accepted Answer Pending Moderation
  1. Friday, 7 September 2018 20:17 PM UTC
  2. PowerBuilder
  3. # 1

It is a RichText DataWindow, not a RichTextControl.

Try the RichTextCurrentStyleChanged event to track changes using an instance boolean.

 

Comment
  1. Bill Asby
  2. Friday, 7 September 2018 20:22 PM UTC
No, it is not a Rich Text DW.

Thanks
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 7 September 2018 18:16 PM UTC
  2. PowerBuilder
  3. # 2

Hi Bill;

   Are you sure that you are looking at an RTE Control?

It shows up OK in my PB2017R3 apps, as follows:

HTH

Regards ... Chris

Comment
There are no comments made yet.
Bill Asby Accepted Answer Pending Moderation
  1. Friday, 7 September 2018 18:05 PM UTC
  2. PowerBuilder
  3. # 3

Chris,

Thanks, however, I am not seeing Modified in the list of events.

Any suggestions on how to implement the Modified event handler?

Thanks,

Bill

Comment
  1. Chris Pollach @Appeon
  2. Friday, 7 September 2018 20:29 PM UTC
It's automatically provided by PB's "System Class" when you add the RTE Control to a User Object or Window in either painter. If you are not seeing the Modified event, then this would be a very serious issue (ie: corrupt source code for an object).
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 7 September 2018 17:40 PM UTC
  2. PowerBuilder
  3. # 4

Hi Bill;

  Just use the Modified event on the RTE control for that.

Regards ... Chris

Comment
  1. Bill Asby
  2. Friday, 7 September 2018 20:27 PM UTC
Hi Chris,

My development machine is off-line right now, otherwise I would upload a screen shot.

I have an RTE sitting on a screen object.

When I am viewing other object event code in PB and then select the RTE control from the PB IDE screen object dropdown, Modified is not in the list of events. Do I need to add it? I will try to get a screen shot next week.

thanks

  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 7 September 2018 20:35 PM UTC
Yes, Screen captures would be useful and no, the Modified event (and many others) should be there for the RTE control scripting and not required to be added.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.