示例#1
0
 @Override
 public void delete() {
   try {
     bc.delete(getId());
     addMessageContext("Registro deletado com sucesso!", SeverityType.INFO);
   } catch (Exception e) {
     addMessageContext("Ocorreu um erro ao deletar o registro!", SeverityType.ERROR);
   }
   redirectListView();
 }
示例#2
0
 @Override
 public void deleteSelection() {
   try {
     boolean delete;
     for (Iterator<String> iter = getSelection().keySet().iterator(); iter.hasNext(); ) {
       String id = iter.next();
       delete = getSelection().get(id);
       if (delete) {
         bc.delete(id);
         iter.remove();
       }
     }
     addMessageContext("Registro deletado com sucesso!", SeverityType.INFO);
     redirectListView();
   } catch (Exception e) {
     addMessageContext("Ocorreu um erro ao deletar o registro!", SeverityType.ERROR);
   }
 }