IDEMPIERE-4171 DB message on delete is lost
This commit is contained in:
parent
3e3f8ac4e9
commit
e2af3a5516
|
@ -104,7 +104,7 @@ public class GridTable extends AbstractTableModel
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -2741647620577906242L;
|
||||
private static final long serialVersionUID = 817894725729408648L;
|
||||
|
||||
public static final String DATA_REFRESH_MESSAGE = "Refreshed";
|
||||
public static final String DATA_UPDATE_COPIED_MESSAGE = "UpdateCopied";
|
||||
|
@ -3432,7 +3432,7 @@ public class GridTable extends AbstractTableModel
|
|||
e.setInfo(AD_Message, info, isError, !isError);
|
||||
}
|
||||
if (isError)
|
||||
log.saveError(AD_Message, info);
|
||||
log.saveWarning(AD_Message, info);
|
||||
fireDataStatusChanged (e);
|
||||
} // fireDataStatusEvent
|
||||
|
||||
|
@ -3499,7 +3499,7 @@ public class GridTable extends AbstractTableModel
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -8735217685095696892L;
|
||||
private static final long serialVersionUID = -6866671239509705988L;
|
||||
|
||||
/**
|
||||
* Construct Loader
|
||||
|
|
|
@ -241,6 +241,19 @@ public class CLogger extends Logger
|
|||
return true;
|
||||
} // saveWarning
|
||||
|
||||
/**
|
||||
* Get Warning message from stack
|
||||
* @param defaultMsg default message (used when there are no warnings on stack)
|
||||
* @return error message, or defaultMsg if there is not error message saved
|
||||
* @see #retrieveError()
|
||||
*/
|
||||
public static String retrieveWarningString(String defaultMsg) {
|
||||
ValueNamePair vp = retrieveWarning();
|
||||
if (vp == null)
|
||||
return defaultMsg;
|
||||
return vp.getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Warning from Stack
|
||||
* @return AD_Message as Value and Message as String
|
||||
|
|
|
@ -2387,6 +2387,14 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
//other error will be catch in the dataStatusChanged event
|
||||
}
|
||||
|
||||
private void showLastWarning() {
|
||||
String msg = CLogger.retrieveWarningString(null);
|
||||
if (msg != null)
|
||||
{
|
||||
statusBar.setStatusLine(Msg.getMsg(Env.getCtx(), msg), true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ToolbarListener#onSaveCreate()
|
||||
*/
|
||||
|
@ -2470,7 +2478,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
adTabbox.getSelectedGridTab().dataRefreshAll(true, true);
|
||||
adTabbox.getSelectedGridTab().refreshParentTabs();
|
||||
if (!success)
|
||||
showLastError();
|
||||
showLastWarning();
|
||||
|
||||
adTabbox.getSelectedTabpanel().dynamicDisplay(0);
|
||||
focusToActivePanel();
|
||||
|
|
Loading…
Reference in New Issue