tags:

views:

21

answers:

0

I am using a custom converter. I am trying to understand why my page is just refreshing and not going to the correct link. My custom converter is working but when I click on a link to go to another page it is hitting the getAsObject method, refreshing the page and not going to the link I clicked. Can someone help me understand why this is happening?

Here is my converter class.

public class CurrencyConverter implements Converter {



public String convertNumber(String text) {    

        double dbText = Double.parseDouble(text);
        NumberFormat formatter = new DecimalFormat("'$'###,###,###,##0.00");
        return formatter.format(dbText);
    }

    @Override
    public Object getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException {

        return value;

    }

    @Override
    public String getAsString(FacesContext context, UIComponent component, Object value) throws ConverterException {
                return this.convertNumber(value.toString());
    }


}