title: jsf changing class of an element
body: <p>I want to change a div's class dynamically based on if an input value is true or false. Thought the function that validates the input is called the class is never changed. Here's the xhmtl:</p>
  
  <pre><code>&lt;td&gt;
      &lt;div class="#{regBean.nameclass}"&gt;
      &lt;h:inputText class="form-control input-sm" value="#{regBean.name}"&gt;
      &lt;f:ajax event="blur" listener="#{regBean.validateName}" render="namemsg" /&gt;
      &lt;/h:inputText&gt;
      &lt;/div&gt;
      &lt;/td&gt;
      &lt;td class="error"&gt;
      &lt;h:outputText  class="error-msg" id="namemsg" value="#{regBean.nameMsg}"&gt;&lt;/h:outputText&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>and here's the function from the according bean:</p>
  
  <pre><code>private static final String SUCCESS="form-group has-success";
  private static final String ERROR="form-group has-error";
  
  
  public void validateName(){     
      if(ValidatorUtilities.empty(name)){
          nameMsg="Παρακαλώ εισάγετε όνομα!";     
      }
      nameMsg=ValidatorUtilities.validateName(name);
  
      if(nameMsg.equals("")){
          nameclass=SUCCESS;
          validations.put("name",true);
      }
      else{
          nameclass=ERROR;
          validations.put("name",false);
      }
  
  }
  </code></pre>
  
  <p>thought the message at element with <code>id="namemsg"</code> is correctly shown the class remains the same. Is there anything wrong or am I going for the wrong implementation and should do this client side by jquery?</p>
  
  <p>Note:I've set the getter-setter for the string nameclass</p>