示例#1
0
 @Override
 public void onRowEdit(RowEditEvent ree) {
   Feature property = (Feature) ree.getObject();
   if (property.getOptionOnDb().equals(property.getOption())) {
     return;
   }
   property.setName(property.getName().trim());
   property.setOption(property.getOption().trim());
   for (String option : propertyRepository.getOptions(property.getName().trim())) {
     if (option != null && option.trim().equals(property.getOption())) {
       super.addFacesMessage(
           FacesMessage.SEVERITY_ERROR, "Opzione gia' presente", "", "featuresList");
       property.setOption(property.getOptionOnDb());
       return;
     }
   }
   super.onRowEdit(ree);
 }