Class ImplicitNumberConverter

  • All Implemented Interfaces:
    PartialStateHolder, StateHolder, Converter

    public class ImplicitNumberConverter
    extends NumberConverter

    This converter won't output the percent or currency symbols, that's up to the UI. This converter will implicitly infer percent or currency symbols on submitted value when absent, just to prevent an unnecessary conversion error.

    Usage

    This converter is available by converter ID omnifaces.ImplicitNumberConverter. Just specify it as <o:converter> nested in the component referring the Number property. For example:

     <span class="currency">
         <span class="symbol">$</span>
         <h:inputText value="#{bean.price}">
             <o:converter converterId="omnifaces.ImplicitNumberConverter" type="currency" currencySymbol="$" />
         </h:inputText>
     </span>
     

    Since OmniFaces 4.5 it's also available by <o:implicitNumberConverter> tag.

     <span class="currency">
         <span class="symbol">$</span>
         <h:inputText value="#{bean.price}">
             <o:implicitNumberConverter type="currency" currencySymbol="$" />
         </h:inputText>
     </span>
     
    Since:
    3.0
    Author:
    Bauke Scholtz