You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by CHUCK SYPERSKI <cs...@dupage88.net> on 2010/03/08 13:56:43 UTC

java.lang.NumberFormatException - For input string:

Here is my issue, I have a panelGrid that looks like this:

<h:panelGrid columnClasses="typicalCell, alignRight"
styleClass="accountDetails" border="0" columns="2"> 
      <f:facet name="header"> 
             <h:outputText value="#{msg.poDescTitle}" /> 
      </f:facet> 
      <h:outputText value="#{msg.poShortDesc}" /> 
       <h:outputText
value="#{visitInfo.purchaseOrder.shortDescription}" /> 
       <h:outputText value="#{msg.poDesc}"></h:outputText> 
        <h:outputText
value="#{visitInfo.purchaseOrder.description}"></h:outputText>
</h:panelGrid>

This outputs correctly for most dataset, but I am hitting a specfic
dataset where "visitInfo.purchaseOrder.shortDescription" has a line like
this:  

24 - xxxxxxxxxxxxxx @ $6.18 EA TOTAL $8.32

In my backing bean the shortDescription is a String, but for some reason
I am getting the following error:


    Exception while calling encodeEnd on component : {Component-Path :
[Class:
org.ajax4jsf.component.AjaxViewRoot,ViewId: /protected/podetails.jsp][Class: javax.faces.component.html.HtmlDataTable,Id: j_id_jsp_189730757_32][Class: javax.faces.component.UIColumn,Id: column3][Class: javax.faces.component.html.HtmlOutputFormat,Id: j_id_jsp_189730757_42]}

    Caused by:
    java.lang.NumberFormatException - For input string: "$6.18 EA"



I am not using a f:convertNumber or anything like that so I don't know
why my string is being converted to a number. Any help would be
appreciated, I am using myfaces 1.2.

Thanks,
Chuck 


Re: java.lang.NumberFormatException - For input string:

Posted by Jakob Korherr <ja...@gmail.com>.
Hi Chuck,

On the first sight it seems like your h:outputText is somehow used as
h:outputFormat.

It would be very great if you could provide the whole stack trace, so that I
could see where the Exception originates and where it is populated.

Regards,
Jakob

2010/3/8 CHUCK SYPERSKI <cs...@dupage88.net>

> Here is my issue, I have a panelGrid that looks like this:
>
> <h:panelGrid columnClasses="typicalCell, alignRight"
> styleClass="accountDetails" border="0" columns="2">
>      <f:facet name="header">
>             <h:outputText value="#{msg.poDescTitle}" />
>      </f:facet>
>      <h:outputText value="#{msg.poShortDesc}" />
>       <h:outputText
> value="#{visitInfo.purchaseOrder.shortDescription}" />
>       <h:outputText value="#{msg.poDesc}"></h:outputText>
>        <h:outputText
> value="#{visitInfo.purchaseOrder.description}"></h:outputText>
> </h:panelGrid>
>
> This outputs correctly for most dataset, but I am hitting a specfic
> dataset where "visitInfo.purchaseOrder.shortDescription" has a line like
> this:
>
> 24 - xxxxxxxxxxxxxx @ $6.18 EA TOTAL $8.32
>
> In my backing bean the shortDescription is a String, but for some reason
> I am getting the following error:
>
>
>    Exception while calling encodeEnd on component : {Component-Path :
> [Class:
> org.ajax4jsf.component.AjaxViewRoot,ViewId:
> /protected/podetails.jsp][Class:
> javax.faces.component.html.HtmlDataTable,Id: j_id_jsp_189730757_32][Class:
> javax.faces.component.UIColumn,Id: column3][Class:
> javax.faces.component.html.HtmlOutputFormat,Id: j_id_jsp_189730757_42]}
>
>    Caused by:
>    java.lang.NumberFormatException - For input string: "$6.18 EA"
>
>
>
> I am not using a f:convertNumber or anything like that so I don't know
> why my string is being converted to a number. Any help would be
> appreciated, I am using myfaces 1.2.
>
> Thanks,
> Chuck
>
>