public class ImplicitNumberConverter
extends jakarta.faces.convert.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.
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>
Constructor and Description |
---|
ImplicitNumberConverter() |
Modifier and Type | Method and Description |
---|---|
Object |
getAsObject(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component,
String submittedValue) |
String |
getAsString(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent component,
Object modelValue) |
clearInitialState, getCurrencyCode, getCurrencySymbol, getLocale, getMaxFractionDigits, getMaxIntegerDigits, getMinFractionDigits, getMinIntegerDigits, getPattern, getType, initialStateMarked, isGroupingUsed, isIntegerOnly, isTransient, markInitialState, restoreState, saveState, setCurrencyCode, setCurrencySymbol, setGroupingUsed, setIntegerOnly, setLocale, setMaxFractionDigits, setMaxIntegerDigits, setMinFractionDigits, setMinIntegerDigits, setPattern, setTransient, setType
public String getAsString(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component, Object modelValue)
getAsString
in interface jakarta.faces.convert.Converter
getAsString
in class jakarta.faces.convert.NumberConverter
Copyright © 2012–2020 OmniFaces. All rights reserved.