Word Count for Text Boxes

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.
3 answers

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.



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 .


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


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