public void fixReloadedAttachments(Map parameterMap) {
   Iterator keys = parameterMap.keySet().iterator();
   while (keys.hasNext()) {
     String key = keys.next().toString();
     String fieldNameStarter = "coiDisclosureRefreshButtonClicked";
     try {
       if (key.indexOf(fieldNameStarter) > -1) {
         // we have a refresh button checker field
         String fieldValue = ((String[]) parameterMap.get(key))[0];
         if ("T".equals(fieldValue)) {
           // a refresh button has been clicked, now we just need to update the appropriate
           // attachment status code
           int numericVal = Integer.valueOf(key.substring(fieldNameStarter.length()));
           CoiDisclosureAttachment attachment = retrieveExistingAttachmentByType(numericVal);
           FormFile file = attachment.getNewFile();
           if (file == null) return;
           byte[] fileData;
           try {
             fileData = file.getFileData();
             if (fileData.length > 0) {
               AttachmentFile newFile = new AttachmentFile();
               newFile.setType(file.getContentType());
               newFile.setName(file.getFileName());
               newFile.setData(file.getFileData());
               attachment.setFile(newFile);
               getBusinessObjectService().save(attachment);
             }
           } catch (Exception e) {
             LOG.error(e.getMessage(), e);
           }
         }
       }
     } catch (Exception e) {
       LOG.error(e.getMessage(), e);
     }
   }
 }