title: Prevent validation messages appeared if fields are disabled
body: <p>I have a check-box that disables some form.</p>
  
  <pre><code>&lt;h:selectBooleanCheckbox id="ldapAuthEnabled" value="#{enabled}" label="check it"&gt;
  </code></pre>
  
  <p>When I check it - it lead to disable all field in my form, so that:</p>
  
  <pre><code>&lt;h:inputText mandatory="true" value="#{someVar}" 
  disabled="#{!enabled}" required="#{enabled}" /&gt;
  </code></pre>
  
  <p>The problem comes up when </p>
  
  <ol>
  <li>I try to safe my form when fields are not disabled - it shows me validation messages!</li>
  <li>Then I click on the check-box, it makes all fields disabled, BUT - it still show me validation messages! So, It even can not go to my controller.safe() method because of this.</li>
  </ol>
  
  <p>The question is: how to make it work as expected? - when fields are disabled, no need to keep validation messages and think that form is not valid.</p>
  
  <p><strong>-- EDIT:</strong></p>
  
  <p>As suggested in the answer (from BalusC), I changed "value" to "binding", so now I have code like this:</p>
  
  <pre><code>&lt;h:panelGroup id="my-panel"&gt;
  
  &lt;h:selectBooleanCheckbox id="myEdit" binding="#{checkbox}" label="enable it!"&gt;
    &lt;f:ajax event="click" render="my-panel"/&gt;
  &lt;/h:selectBooleanCheckbox&gt;
  
  &lt;h:inputText id="name" value="#{bean.name}" disabled="#{not checkbox.value}" required="true" /&gt;
     &lt;h:outputText value="sometext"/&gt;                      
  &lt;/h:panelGroup&gt;
  </code></pre>
  
  <p>Where <code>"&lt;h:panelGroup id="my-panel"&gt;"</code> is part of the "form".</p>
  
  <p>But have the same result - validation error that prevent me to do save().</p>
  
  <p>I use "SessionScope" for my bean now.</p>