Search code examples
ajaxjsficefacesicefaces-1.8

JSF inputTextArea valueChangeListener


Is there any way to force firing of valueChangeListener during typing into an component?

I am trying to simply count the number of chars user has entered in the textArea without resorting to JavaScript coding, but it simply won't budge.

Any ideas would be appreciated.

Here's the code:

<ice:inputTextarea maxlength="4000" style="height: 400px; width: 400px;" 
value="#{controller.remarkText}"
valueChangeListener="#{controller.updateTextCount}" />

<ice:inputText readonly="true" size="3" maxlength="4" value="#{controller.remarkTextCharCount}" />

We're using IceFaces 1.8.2 and JSF 1.2.


Solution

  • Did you try adding partialSubmit="true" , that said however it would be submitting every character to the server and that is not an ideal solution. A simple javascript based validation is valid for this use case.

    Cheers!