Reputation: 149
I get a error: Conversion error:
{0}: Conversion error occurred.
when try to display O value in Primefaces knob component. I already changed input value types to: integer, String, Double and this did not help. I also tried to build a converter, but this component did not use it. I do not have any idea what do with this. I have no idea how to solve this problem.
<p:knob value="#{res.completionValue}" width="50" height="50" disabled="true" converter="knobConverter" />
Converter:
@FacesConverter("knobConverter")
public class KnobConverter implements Converter {
public Object getAsObject(FacesContext fc, UIComponent uic, String value) {
Integer returnValue;
if(value != null && value.trim().length() >0) {
try{
returnValue = (ing) value;
}
catch(NumberFormatException e) {
throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Conversion Error", "Not a valid theme."));
}}
return returnValue;
}
public String getAsString(FacesContext fc, UIComponent uic, Object object) {
if(object != null) {
return String.valueOf((object));
}
else {
return null;
}
}
}
Upvotes: 1
Views: 74
Reputation: 149
I deleted the entire class and recreated it (return Integer values, do no use Converter). Now it work correct, generally I do not have any idea what was the reason.
Upvotes: 1