0

I'm using primefaces 3.5,WebLogic server in JDeveloper.

Validation part of my .xhtml file is:

<h:outputLabel value="Route Id "></h:outputLabel>
   <p:inputText id="rouid" value="#{addcust.c1.routeid}"
      listener="#{addcust.routedata}" title="Click to Select Route" required="true" requiredMessage="Enter route ID" validatorMessage="Id must contain Digits">
<f:validateLength minimum="0" maximum="11"/>
</p:inputText>

mybean.java:

private Integer routeid;
    public void setRouteid(Integer routeid) {
        this.routeid = routeid;
    }

    public Integer getRouteid() {
        return routeid;
    }
prabhakar
  • 40
  • 1
  • 8

1 Answers1

4

Change your int field to Integer. This will default to null unless it is initialized explicitly.

Piyush Khera
  • 467
  • 5
  • 9
  • 1
    Thanks for reply.It's Working,But i had a problem with validate messages after changing int to Integer.The growl messages are not showing the validate message i wrote.It Showing like Regex Pattern is not matched.And what is the difference between int and Integer . – prabhakar Oct 29 '13 at 06:24
  • Integer is a class in java where as int is a primitive type. Integer object have methods that can be used to perform different operations. Could you please post your validation code? – Piyush Khera Oct 29 '13 at 06:49
  • Thanks for Replying.The validation code is: . – prabhakar Oct 29 '13 at 07:40
  • Could you please edit the original question to add your bean class and xhtml code? – Piyush Khera Oct 29 '13 at 07:44
  • Sorry for the delay. If you still have this problem, could you tell me in which case does the error message say "Regex Pattern is not matched"? – Piyush Khera Mar 10 '14 at 12:54