2 Replies Latest reply on Apr 18, 2012 8:47 AM by skotinin

    formatting parameters to h:outputFormat

    cmathrusse

      RichFaces 4 M5

       

       

      Attempting to format a resource string that contains a placeholder for a parameter to be passed. I'm using the

      h:outputFormat component and supplying it a parameter from a backing bean, but I am having difficulty figuring out how

      to format the parameter.

       

       

      My resource string is as follows: label.termsAndConditionsExplanation = When you press Confirm, your credit card will

      be charged USD {0} which will reserve your program.

       

       

      And I am rendering the output as folllows:

       

      <h:outputFormat value="#{msgs['label.termsAndConditionsExplanation']}">

           <f:param value="#{estimate.initialQuoteAmount}"/>

      </h:outputFormat>

       

      The estimate.initialQuoteAmount is defined as a java.math.BigDecimal. If it contains a value of 175.00, the formated

      output renders the following:

       

       

      When you press Confirm, your credit card will be charged USD 175 which will reserve your program.

       

       

      What I would like to do is apply an <f:convertNumber pattern="#,###.00" />

       

      But I can't seem to figure out how this can be accomplished. <f:param> does not allow for a nested <f:converter> tag.

       

       

      So how can I apply a format to the parameter to the h:outputFormat?

       

       

      Thanks for the help...