 <p>First turn that validation method into a true <a href="http://docs.oracle.com/javaee/7/api/javax/faces/validator/Validator.html" rel="nofollow"><code>Validator</code></a> implementation.</p> <pre><code>@FacesValidator("topicValidator") public TopicValidator implements Validator {} </code></pre> <p>Then you can use it in a <a href="https://docs.oracle.com/javaee/7/javaserver-faces-2-2/vdldocs-facelets/f/validator.html" rel="nofollow"><code>&lt;f:validator&gt;</code></a> which supports <code>disabled</code> attribute.</p> <pre><code>&lt;h:inputText ...&gt; &lt;f:validator validatorId="topicValidator" disabled="..." /&gt; &lt;/h:inputText&gt; </code></pre> <p>To let it check if a certain button is pressed, just check the presence of its client ID in the request parameter map.</p> <pre><code>&lt;h:inputText ...&gt; &lt;f:validator validatorId="topicValidator" disabled="#{empty param[secondButton.clientId]}" /&gt; &lt;/h:inputText&gt; ... &lt;h:commandButton binding="#{secondButton}" ... /&gt; </code></pre> <p>Note: do absolutely not bind it to a bean property! The above code is as-is. You should only guarantee that the EL variable <code>#{secondButton}</code> is unique in the current view and not shared by another component or even a managed bean.</p> <h3>See also:</h3> <ul> <li><a href="http://stackoverflow.com/questions/8370675/how-to-let-validation-depend-on-the-pressed-button">How to let validation depend on the pressed button?</a></li> <li><a href="http://stackoverflow.com/questions/14911158/how-does-the-binding-attribute-work-in-jsf-when-and-how-should-it-be-used">How does the &#39;binding&#39; attribute work in JSF? When and how should it be used?</a></li> </ul>