Preventing content insertion
Posted: Tue Jul 03, 2012 2:40 pm
I'm trying to restrict a user from entering more than 2000 characters for a given element. Whereby the content the user is trying to insert is ignored. I'm currently looking at the AuthoringListenerAdapter beforeContentInsert method and I can count the text content but I'm struggling to prevent the component from adding the text.
The other way I've thought of is to change and use the contentInserted method and then manually code for the removing of the inserted text. Which could get quite messy if there are nested nodes.
Can you please advise what the best approach will be?
The other way I've thought of is to change and use the contentInserted method and then manually code for the removing of the inserted text. Which could get quite messy if there are nested nodes.
Can you please advise what the best approach will be?