title: JSF h:inputText validation and f:ajax render
body: <p>A very simple JSF applicaton:</p>
  
  <ul>
  <li>InputText element is assigned with Validator. </li>
  <li>f:ajax is used to render next element (phoneNumber) by using <code>blur</code> event.</li>
  <li>PhoneNumber will only be displayed if inputText pass the validator and isValid boolean value is set to true</li>
  </ul>
  
  <p>Here is the code snippet</p>
  
  <pre><code>&lt;h:form id="invOrdersWizForm"&gt;                                  
      &lt;h:inputText id="name" maxlength="9" styleClass="ordLabelNarrow"
          validator="#{person.validatePerson}"                                
          value="#{person.name}"&gt;
          &lt;f:ajax render="phoneLabel" event="blur"/&gt;                                                              
      &lt;/h:inputText&gt;  
      &lt;h:outputText id="phoneLabel"
          rendered="#{person.isValid}"                        
          styleClass="ordLabelWide" value="#{person.phoneNumber}" /&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>ManagedBean</p>
  
  <pre><code>public void validatePerson(FacesContext context, UIComponent toValidate, Object value) {
      name = ((String) value).toUpperCase();
      phoneNumber = "12345678";
      isValid = true;
  }
  </code></pre>
  
  <p>The problem is, for some reason, the phoneNumber is not rendered at all.</p>
  
  <p>The only way that I can make it work is by changing f:ajax to render @form</p>
  
  <pre><code>&lt;h:inputText id="name" maxlength="9" styleClass="ordLabelNarrow"
      validator="#{person.validateSecurityCode}"                              
      value="#{person.name}"&gt;
      &lt;f:ajax render="@form" event="blur"/&gt;                                                               
  &lt;/h:inputText&gt;  
  </code></pre>
  
  <p>Or remove rendered from phoneNumber</p>
  
  <pre><code>    rendered="#{person.isValid}"
  </code></pre>
  
  <p>For some reason f:ajax with specific element Id and rendered based on managedBean Attribute  cannot co-exist. </p>
  
  <p>Any idea or advice guys?</p>
  
  <p>NOTE: this behaviour also happen when I use listener instead of validator</p>