I've written a custom Renderer Class to fix Primefaces issue#5869 and am now trying to use it on the website I'm working on. I've done so by including
<renderer>
<component-family>org.primefaces.component</component-family>
<renderer-type>org.primefaces.component.inputtext.InputTextRenderer</renderer-type>
<renderer-class>at.ac.uibk.library.utils.fixedInputTextRenderer</renderer-class>
</renderer>
in my faces-config.xml. But it's still possible to insert more than the specified character limit with js.
I added these lines in the fixedInputTextRenderer which should do the necessary check
if (submittedValue != null) {
int maxlength = inputText.getMaxlength();
if (maxlength > 0 && submittedValue.length() > maxlength) {
submittedValue = submittedValue.substring(0, maxlength);
}
inputText.setSubmittedValue(submittedValue);
}