NullPointer on p:inputMask

UI Components for JSF
Post Reply
fiktion
Posts: 100
Joined: 25 Aug 2010, 17:47

20 Sep 2010, 18:21

I am trying to use an p:inputMask for a SSN but I keep getting this when I hit the search button. The error I get is below.

Code: Select all

java.lang.NullPointerException
       org.primefaces.component.inputmask.InputMaskRenderer.getConvertedValue(InputMaskRenderer.java:101)
This is what my code looks like, it is pretty basic

Code: Select all

 <h:panelGroup layout="block" rendered="#{myBean.item == 'searchSSN'}">
           <h:panelGroup layout="block" id="ssn">
                 <h:outputText value="SSN: " />
                 <p:inputMask id="inputSSN" mask="999-99-9999" />
           </h:panelGruop>
   </h:panelGroup>

  <h:panelGroup layout="block">
       <p:commandButton value="Search" update="results" />
  </h:panelGroup>

  <h:panelGroup id="results">
       <h:panelGroup>
            <h:outputText value="#{myBean.results}" />
       </h:panelGroup>
  </h:panelGroup>

callahan
Posts: 768
Joined: 27 May 2010, 22:52

20 Sep 2010, 23:52

Hi,

The p:inputMask tag is being used without a value attribute.

keess
Posts: 1
Joined: 03 Mar 2011, 12:02

03 Mar 2011, 12:19

The strange thing is that when you use a p:inputText you will not get a NullPointerException. As it works now it is hard to create a prototype for a customer since every field with a mask needs to be backed by a managed bean.
Success, kees.

User avatar
Martijn Baels
Posts: 6
Joined: 06 Mar 2011, 22:28
Location: The Netherlands
Contact:

06 Mar 2011, 22:51

I agree, it would be nice if some check in the code is added to prevent this NullPointer. Other components with the same problem already got a fix for the issue (see related postings in the forum). It just makes the code less fragile and helps to get these components stable in any situation (with value/without value, with backing bean/without a backing bean, nested as part of a composite component, and so on).
Primefaces 3.0 M3 SNAPSHOT, Mojarra 2.1 FCS, WebLogic 10.3.5

User avatar
ydarcin
Posts: 258
Joined: 04 Jan 2009, 19:02
Location: Turkey

07 Mar 2011, 10:15

Hi,

just created the issue.

http://code.google.com/p/primefaces/iss ... il?id=1823

will be fixed in 3.0

Yigit


User avatar
ydarcin
Posts: 258
Joined: 04 Jan 2009, 19:02
Location: Turkey

08 Mar 2011, 09:59

it was quick ... as usual :)

User avatar
Martijn Baels
Posts: 6
Joined: 06 Mar 2011, 22:28
Location: The Netherlands
Contact:

08 Mar 2011, 10:47

That's the spirit. Thanks guys! :D
Primefaces 3.0 M3 SNAPSHOT, Mojarra 2.1 FCS, WebLogic 10.3.5

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 38 guests