3 Replies Latest reply on Jul 31, 2008 8:56 PM by Neil C

    f:convertNumber Disrupting JPDL Pageflow

    Neil C Novice

      I am working with a JPDL pageflow for a typical order process, and I was finding that this one page near the end was causing a problem.  By problem, I mean that when I pressed the button to move forward, the pageflow simply bounces me back to the same page but without the coversation ID in the querystring.  The debug page shows me that the conversation is still ongoing, but the pageflow has lost it.  I can navigate to the page after the offending page from the page before it, so clearly something is up with this one page.


      After ripping the page apart and adding pieces to it bit by bit, I found the offending item.  I assumed it would be one of my a4j tags, but I was shocked to find that it was in fact f:convertNumber.


      When I have the following in my facelet, the pageflow works:


      <h:inputText value="#{payment.amount}" required="true" id="amountBox"/>
      



      When I instead have this, it doesn't:


      <h:inputText value="#{payment.amount}" required="true" id="amountBox">
            <f:convertNumber minFractionDigits="2" maxFractionDigits="2"/>
      </h:inputText>
      



      Something with the number converter is disrupting my pageflow. 


      Any insight into how I can resolve this issue is very much appreciated.  Please let me know if I can provide further information.


      Thanks.




        • 1. Re: f:convertNumber Disrupting JPDL Pageflow
          Neil C Novice

          I should also mentioned that I added logging for javax.faces, but no new logs were produced by the NumberConverter


          I understand the correlation vs. causation issue, so I know that just because the NumberConverter's present when the pageflow fails doesn't mean it is causing it to fail.  Still, I am baffled as to what the issue might be.


          I am just about at my wit's end.  Any insight is truly appreciated.


          Thanks.

          • 2. Re: f:convertNumber Disrupting JPDL Pageflow
            Neil C Novice

            Well, it may be that it is an issue of NumberConverter not working with BigDecimal, which is the type of the amount property shown above.


            Has anyone else run into issues with this?


            Thanks.

            • 3. Re: f:convertNumber Disrupting JPDL Pageflow
              Neil C Novice

              I tested that when I change the component value from BigDecimal to merely double, everything works.  At least I now know what the issue is.


              I am now creating my own converter, which is a fairly simple matter.  However, I am having trouble finding any literature on a very simple thing--passing parameters to my custom converter. 


              So while I can do this:


              <f:convertNumber minFractionDigits="2" maxFractionDigits="2"/>
              



              I can't do something like this:


              <f:converter converterId="bigDecimalCurrencyConverter">
                       <f:param name="minFractionDigits" value="2"/>
                       <f:param name="maxFractionDigits" value="2"/>
              </f:converter>
              



              I know at this point this has become a JSF question.  (Then again, I think the failure of the standard converter causing the pageflow to stall might be interesting to some.)  But I am hoping the JSF experts here know this one since it seems fairly trivial, which makes the lack of resources on the topic so surprising.


              Thanks.