TextField fecha = new TextField("fecha", Date.class)
{
public IConverter getConverter()
{
return new IConverter()
{
public Object convert(Object o, Class c)
{
try
{
return new
SimpleDateFormat("dd-MM-yyyy").parse((String)o);
}
catch(ParseException pex)
{
return null;
}
}
public void setLocale(Locale loc)
{}
public Locale getLocale()
{
return Locale.getDefault();
}
};
}
} ;
but a ClassCastException is thrown, since the method is called twice, once with a String value and once with a Date value. I don't know what is going on, any help on this would be appreciated or a simpler way to accomplish what I want to do .
Thanks.
Blab-away for as little as 1ยข/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
