title: JSF: how to hide outputText when validateLongRange fails
body: <p>I have the following code:</p>
  
  <pre><code>&lt;h:form&gt;
      &lt;h:inputText id="inputField" value="#{bean.myProperty}"&gt;
          &lt;f:validateLongRange
              minimum="#{bean.minimum}"
              maximum="#{bean.maximum}"/&gt;
      &lt;/h:inputText&gt;
      &lt;h:commandButton id="submit" value="Submit" &gt;
          &lt;f:ajax execute="inputField" render="outputField errors" /&gt;
      &lt;/h:commandButton&gt;
      &lt;h:outputText id="outputField" value="#{bean.myPropertyFormatted}"/&gt;
      &lt;h:message id="errors" for="inputField"/&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>When validation fails on the inputText, I would like to remove/hide the outputText from the user. What is the most elegant and future-refactoring-proof way to do this?</p>
  
  <p>I tried setting the attribute <code>rendered="#{!facesContext.validationFailed}"</code> on the outputText element, but that only determines whether or not the outputText element is RE-rendered, as opposed to leaving the old text unchanged. However, when the validateLongRange validation fails, I want to completely remove/hide the outputText from the user, since the user will be seing the validation error message and is not interested in seing an old output message based on a previous, valid input which is still the value stored in the bean.</p>