your must write a Converter. Here is the example:
public class CustomConverter implements Converter {
public Object getAsObject(FacesContext facesContext, UIComponent component,
String string)
throws ConverterException {
if (StringUtil.isStrEmpty(string))
return null;
try {
Integer.valueOf(string);
} catch (Exception e) {
return string;
}
return Integer.valueOf(string);
}
public String getAsString(FacesContext facesContext, UIComponent component, Object object)
throws ConverterException {
if (object == null)
return null;
if (object instanceof java.util.Date) {
return DateUtil.formatDate((Date) object, "dd/MM/yyyy");
}
return String.valueOf(object);
}
}