2 Replies Latest reply on Aug 28, 2008 10:36 AM by Alexandre Costa

    Help on form validation

    Alexandre Costa Newbie

      Hello,


      I have the following form:



      <h:outputText value="Pesquisar documentos inseridos entre " />
      <rich:calendar value="#{gestDocuments.dataA}" datePattern="dd/MM/yyyy" required="true" requiredMessage="Insira o limite inferior na data"></rich:calendar>
      <h:outputText value=" e " /> 
      <rich:calendar value="#{gestDocuments.dataB}" datePattern="dd/MM/yyyy" required="true" requiredMessage="Insira o limite superior na data"></rich:calendar>
      <h:commandButton action="#{gestDocuments.searchBetween}" value="Pesquisar"></h:commandButton>
      
      <br />
      <h:outputText value="Pesquisar na metadata: " />
      <h:inputText value="#{gestDocuments.metadataSearch}" required="true" requiredMessage="Insira o valor a pesquisar.">
          <s:validate></s:validate>
      </h:inputText>
      <h:commandButton action="#{gestDocuments.searchMetadata}" value="Pesquisar"></h:commandButton>



      How can I validate this? If I press the first button, I don't want to validate the inputText and if I press the second button I don't want to validate the dates. I've tried adding the immediate attribute on the buttons, but that will not work in this case.


      How can I fix this?


      Thanks!