Word Count for Text Boxes

1
I need a word count of 300 for my Text Box area. What can I do to get this? I want it to look like the image below but cannot get this to function in Mendix. I know I can limit the characters and lines but I would like to only limit the words.
asked
3 answers
3

Hi Kamryn ,

 

Unfortunately, I couldn't think of an easier solution either, so I think the easiest way is to count the spaces. I wanted to make a short explanation about it. First you will need Java community commons (download from marketplace). You can split the text into words using the "String split" action in a microflow. And by counting this word list, you will reach the number of words. I'll try to picture it when I can. I hope it helps.

 

Regards
Ridvan

This is for demo entity

This is for showing on page . The text area should have on change event (call a microflow).

This is on change action part 

This is microflow . In it you can split the text into words and then you can count it .

This is split part . The sprit parameter should be ‘ ‘ to count the spaces .

answered
2

Count the amount of spaces used? 100 words would mean maximum of 99 spaces?

answered
1

This is so helpful thank you. I will try to recreate it and let you know how it goes! Thanks again! 

 

answered