TextArea/RichTextArea with real-time text analyzing

Hi Guys,

I need for my server-side application a TextArea or a RichTextArea that will analyze word-by-word the input inserted by the user, and will highlight words of a certain type, for example - dates and times.

My problem is that a RichTextArea does not have a TextChangeListener, and a regular TextArea does not have a highlighting option because it does not support HTML tags…
I tries using ShortcutKeyListener for RichTextArea and analyze the text after every Space key, but it was too slow and had also some other problems.

Is there anything else i can do?
Is there an option to analyze the text on real time when using RichTextArea? or is there any add-on youre familiar with that can do that?
Or is there a way to highlight text in TextArea after analyzing it?

Thank you!
Sivan

The TextArea component is very basic; it doesn’t include ny of the features you mentioned. Analysing the text is still doable, one way being adding a client-side listener for keypresses and sending an event to the server (basically the same as the Textfield does with TextChangeListener). Sending the whole text back and forth will create a lot of network traffic though; add the time for text processing and it might become too slow to be usable. The best way would be to build a custom component and do all processing client side.

Can’t help you with the formatting, sorry.

I found some really cool Add-On that i could adjust to my needs - AceEditor:

https://vaadin.com/directory#addon/aceeditor

I can highlight any text using a TextChangeListener and a highlighting method.

Yeah, that should work. Good find :slight_smile: