I have been struggling with this for a few days now, and I have tried many different ways (i.e. wrong ways) to get the correct events to fire so that when the contents of the RTF's Source Tab (which is now a CodeMirror Area)
I have the CodeMirror ability on both the Component's main source tab and the RTF fields Source Tab. Switching between the tabs works okay, and initializing CodeMirror on any of the source tabs works well, saving works well, everything seems to work well except for ONE thing.
Open component, go to RTF source tab, enable CodeMirror, change content, click design tab, contents of design tab are updated, click the main component source tab, contents are updated (to what was changed in the CodeMirror area) == OK
Open component, go to RTF source tab, enable CodeMirror, change content, click the main component source tab, contents are NOT updated (to what was changed in the CodeMirror area) == NOT OK
I cannot get the correct behavior to trigger the updating of the contents when going directly from the RTF source tab with CodeMirror enabled.
Please, suggest any additional triggers I may fire when the contents of the RTF is changed so that the main source tab's contents is also then updated?
Things I have tried that did not work, or I did wrong...
- I have tried to fire the onchange event on the original text area.
- I have tried to set the "updated" flag on the SourceArea (Tab) property.
- I have tried turning the CodeMirror back to TextArea, which is then updated with the correct content, but even then when switching to the main source tab, the contents are not updated, which is crazy!
- I have tried banging my head against the screen and many other angles
I can share the code with someone that needs it.