Mark,
Thanks for your response. I tell you that I could solve the problem.
As you said, I Customized the Attachments List Control. I replaced the Action that was called in the Save Button that appeared in the pop-up window for attaching the file.
The Action that I wrote is the following:
public void buttonSave() throws Exception {
getAttachmentsListControlBean_1().button1_action();
List<IAttachmentItem> files = getTemporaryAttachmentsProvider().listAttachments();
int listSize = files.size();
IAttachmentItem lastFile = files.get(listSize-1);
int ind = lastFile.getFileName().indexOf(" [1]");
if (ind != -1){
String fileName = lastFile.getFileName().substring(0, ind);
for (int i = 0; i < listSize-1; i++) {
IAttachmentItem f = files.get(i);
if (f.getFileName().equals(fileName)){ getTemporaryAttachmentsProvider().removeAttachment(lastFile.getId());
error(FacesMessage.SEVERITY_WARN, "MESSAGE", null);
break;
}
}
}
}
[/code]
Regards,
Marcelo
#webMethods-BPMS#webMethods#MWS-CAF-Task-Engine