GWT RichTextArea detection 'dirty' state

I want to detect when the content of my GWT RichTextArea becomes dirty (was modified by the user) to enable the Save button.

I suppose I could listen for keystrokes that probably changed the content; but browser support for key presses is notoriously quirky.

I suppose before starting editing, store the original content in a variable, and when a key is pressed, compare the current content with that variable, but doing so will be very slow on each key press.

Is there some neat way to detect dirty RichTextArea detectors?

+2


a source to share


1 answer


You can always compare the original text with the current text on the timer (every second or two). Start the timer in onFocus()

and stop itonBlur()



0


a source







All Articles