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;
|
UploadEvent ue = (UploadEvent) e;
|
||||||
processUploadMedia(ue.getMedia());
|
processUploadMedia(ue.getMedia());
|
||||||
} else if (e.getTarget() == bOk || DialogEvents.ON_WINDOW_CLOSE.equals(e.getName())) {
|
} else if (e.getTarget() == bOk || DialogEvents.ON_WINDOW_CLOSE.equals(e.getName())) {
|
||||||
|
if (m_attachment != null) {
|
||||||
String newText = text.getText();
|
String newText = text.getText();
|
||||||
if (newText == null)
|
if (newText == null)
|
||||||
newText = "";
|
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.setBinaryData(new byte[0]); // ATTENTION! HEAVY HACK HERE... Else it will not save :(
|
||||||
m_attachment.setTextMsg(text.getText());
|
m_attachment.setTextMsg(text.getText());
|
||||||
m_attachment.saveEx();
|
m_attachment.saveEx();
|
||||||
|
m_change = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_attachment.delete(true);
|
m_attachment.delete(true);
|
||||||
|
@ -500,6 +502,7 @@ public class WAttachment extends Window implements EventListener<Event>
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose();
|
dispose();
|
||||||
|
}
|
||||||
} else if (e.getTarget() == bCancel) {
|
} else if (e.getTarget() == bCancel) {
|
||||||
// Cancel
|
// Cancel
|
||||||
dispose();
|
dispose();
|
||||||
|
|
Loading…
Reference in New Issue