This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Oct 21, 2011, 1:45 PM
8 Posts

Input Type number crash tiying string

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags: input number convert
  • Replies: 3
 I want a input type number integer only.
 
Sample standard code is: 
 <xp:inputText value="#{documentSource.fieldName}" id="xdnN" size="3" maxlength="3">
<xp:this.converter>
<xp:convertNumber type="number">
</xp:convertNumber>
</xp:this.converter>
</xp:inputText>
 
If i submit string value http return exception:
 
javax.faces.FacesException: For input string: "string value"
com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:105)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:96)
com.ibm.xsp.controller.FacesControllerImpl.execute(FacesControllerImpl.java:250)
 
 I can check the code by client but i I prefer to work with server-side objects?
 
suggestion? 
 
 
 
Oct 21, 2011, 4:24 PM
149 Posts
Re: Input Type number crash tiying string
 
maybe put some ssjs validation in the document source querysave?
 
 
/Thomas
Oct 21, 2011, 5:51 PM
272 Posts
Re: Input Type number crash tiying string
Hi,
 
I have added the code to a blank XPage, and it worked without any problems!?
How do you submit the string?
 
Sven
Oct 24, 2011, 8:10 AM
8 Posts
Re: Input Type number crash tiying string
 Sorry. The problem appears only in the presence of the check only integer.
 
 <xp:inputText value="#{documentSource.fieldName}" id="xdnN" size="3" maxlength="3">
<xp:this.converter>
<xp:convertNumber type="number" integerOnly="true"></xp:convertNumber>
</xp:this.converter>
</xp:inputText>
 
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal