I'm using primefaces(3.0.M2) rich editor for receiving input from user. The restriction is 5000 characters. When user tries to copy from external sources or beautify the content additional tags are getting added to preserve the format.
Now to validate the max length of 5000, I need to strip out the tags and only count the characters length. How to get the characters alone from in managed bean for validation?
client side validation snippet:
<p:editor id="customerInfo" value="#{companyBean.body}"
required="false" requiredMessage="Info required" height="250" width="450"
validatorMessage="Only 5000 characters allowed">
<f:validateLength maximum="5000" />
</p:editor>
<p:editor maxlength="5000" ....see this : code.google.com/p/primefaces/issues/detail?id=5068 - Daniel