2 Replies Latest reply on May 1, 2007 4:34 PM by Keith Naas

    Changeing Validation Messages

    Sean Burns Newbie

      Hello,

      How do you change the validation message for a particular field.

      I have a field that has to be 6 digits, and the messages says

      length must be between 6 and 6


      which just looks wrong, I would rather the message says
      Debtor Code must be 6 digits



      The Code I use is
      /**
       * @return the debtorCode
       */
       @Length(min=6,max=6)
       public String getDebtorCode() {
       return debtorCode;
       }

      and
      <s:decorate id="debtorCodeDecoration" template="layout/edit.xhtml">
       <ui:define name="label">Debtor Code</ui:define>
       <h:inputText id="debtorCode" required="true"
       value="#{CaptureLead.debtorCode}">
       <a:support event="onblur" reRender="debtorCodeDecoration"/>
       </h:inputText>
       </s:decorate>


      I have already tried
      /**
       * @return the debtorCode
       */
       @Length(min=6,max=6,message="blah blah")
       public String getDebtorCode() {
       return debtorCode;
       }
      

      Which does not do anything.

      Any Help?
      Thanks.
      Sean