IDEMPIERE-2596 Lost changes when attachment window is closed / avoid NPE and duplicated process of changes
This commit is contained in:
parent
ffd2288dfd
commit
15a7173e64
|
@ -478,6 +478,7 @@ public class WAttachment extends Window implements EventListener<Event>
|
|||
UploadEvent ue = (UploadEvent) e;
|
||||
processUploadMedia(ue.getMedia());
|
||||
} else if (e.getTarget() == bOk || DialogEvents.ON_WINDOW_CLOSE.equals(e.getName())) {
|
||||
if (m_attachment != null) {
|
||||
String newText = text.getText();
|
||||
if (newText == null)
|
||||
newText = "";
|
||||
|
@ -493,6 +494,7 @@ public class WAttachment extends Window implements EventListener<Event>
|
|||
m_attachment.setBinaryData(new byte[0]); // ATTENTION! HEAVY HACK HERE... Else it will not save :(
|
||||
m_attachment.setTextMsg(text.getText());
|
||||
m_attachment.saveEx();
|
||||
m_change = false;
|
||||
}
|
||||
} else {
|
||||
m_attachment.delete(true);
|
||||
|
@ -500,6 +502,7 @@ public class WAttachment extends Window implements EventListener<Event>
|
|||
}
|
||||
|
||||
dispose();
|
||||
}
|
||||
} else if (e.getTarget() == bCancel) {
|
||||
// Cancel
|
||||
dispose();
|
||||
|
|
Loading…
Reference in New Issue