public Object getAsObject(FacesContext context, UIComponent component, String value) {
if(value!=null){
int regionId = Integer.parseInt(value);
ValueBinding valueBinding = context.getApplication().createValueBinding("#{regionDAO}");
RegionDAO regionDAO = (RegionDAO) valueBinding.getValue(context);
try {
return regionDAO.loadRegion(new Integer(regionId));
} catch (RegionNotFoundException e) {
return null;
}
}
return null;