2 Replies Latest reply on Feb 13, 2008 7:34 AM by thejavafreak

    Money input component

    thejavafreak

      Hi all,

      Is there any input component for money type input?

      So the input will only restrict number to be inserted and it will add thousands separator each time user press the key/insert the number

      I tried the rich:inputNumberSpinner but it does not add thousand separator.

      Thanks in advance

        • 1. Re: Money input component
          daniel.soneira

          the only way (that I know of) to input an amount is doing like this:

          <h:inputText value="#{BackingBean.amount}">
           <s:convertNumber type="currency" maxFractionDigits="2" groupingUsed="true"/>
          </h:inputText>
          


          s:convertNumber is a tag from http://myfaces.apache.org/sandbox.


          This will NOT prevent the user from typing in characters when he presses a key within the input field. But the validation / conversion will show him an error, when he submits the form.

          • 2. Re: Money input component
            thejavafreak

            Thanks,

            I thought I can do this in ajax4jsf or richfaces.

            :)