I am working with jsf and Primefaces components. I need do clic the commandButton depending on an input value. This is my html code:
<h:form id="mainform">
<p:panel id="panelform" header="Email Extractor" >
<h:panelGrid id="formulaire" columns="2">
<h:panelGroup id="formblock" layout="block" >
<p:panelGrid columns="2">
<p:outputLabel for="Emailsnbr" value="Enter the emails'number:" />
<p:inputText id="Emailsnbr" type="number" requiredMessage="Emails number is required"
value="#{mailMB.number}" required="true" label="Emailsnbr">
</p:inputText>
</p:panelGrid>
</h:panelGroup>
</h:panelGrid>
<c:if test="#{mailMB.number gt 10}">
<p:commandButton value="Extract" style="width: 8%;height: 100%" update="tableemails, :confirmPurchase, :mainform" id="extractbutton" ajax="true" widgetVar="ButtonExtract"
actionListener="#{mailMB.searchEmails()}"
oncomplete="if (args && !args.validationFailed) purchase.show();"/>
</c:if>
<c:if test="#{mailMB.number lt 11}">
<p:commandButton value="Extract" style="width: 8%;height: 100%" update="tableemails, :confirmPurchaseTest, :mainform" id="extractbuttonTest" ajax="true" widgetVar="ButtonExtract"
actionListener="#{mailMB.searchEmails()}"
oncomplete=" if (args && !args.validationFailed) emailsList.show();"/>
</c:if>
</p:dialog>
</p:panel>
</h:form>
the commandButton in the tag <c:if test="#{mailMB.number lt 11}">
is always invoked and never the one in the tag <c:if test="#{mailMB.number gt 10}">
either i enter 9 or 15 as a value of the number input.
Any explanation and help how make this work?