Errors for processes run from included tab should be shown.

Thanks to Low.
Sponsored by Metas GmbH.

Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=3015917
This commit is contained in:
teo_sarca 2010-06-14 15:49:59 +00:00
parent e4f4e925ff
commit 4901016de8
4 changed files with 96 additions and 31 deletions

View File

@ -875,11 +875,20 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
* Refresh all data * Refresh all data
*/ */
public void dataRefreshAll () public void dataRefreshAll ()
{
dataRefreshAll(true);
}
/**************************************************************************
* Refresh all data
* @param fireEvent
*/
public void dataRefreshAll (boolean fireEvent)
{ {
log.fine("#" + m_vo.TabNo); log.fine("#" + m_vo.TabNo);
/** @todo does not work with alpha key */ /** @todo does not work with alpha key */
int keyNo = m_mTable.getKeyID(m_currentRow); int keyNo = m_mTable.getKeyID(m_currentRow);
m_mTable.dataRefreshAll(); m_mTable.dataRefreshAll(fireEvent);
// Should use RowID - not working for tables with multiple keys // Should use RowID - not working for tables with multiple keys
if (keyNo != -1) if (keyNo != -1)
{ {
@ -896,8 +905,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
} }
} }
} }
setCurrentRow(m_currentRow, true); setCurrentRow(m_currentRow, fireEvent);
fireStateChangeEvent(new StateChangeEvent(this, StateChangeEvent.DATA_REFRESH_ALL)); if (fireEvent)
fireStateChangeEvent(new StateChangeEvent(this, StateChangeEvent.DATA_REFRESH_ALL));
} // dataRefreshAll } // dataRefreshAll
/** /**
@ -905,7 +915,16 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
*/ */
public void dataRefresh () public void dataRefresh ()
{ {
dataRefresh (m_currentRow); dataRefresh(true);
}
/**
* Refresh current row data
* @param fireEvent
*/
public void dataRefresh (boolean fireEvent)
{
dataRefresh (m_currentRow, fireEvent);
} // dataRefresh } // dataRefresh
/** /**
@ -913,11 +932,22 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
* @param row index * @param row index
*/ */
public void dataRefresh (int row) public void dataRefresh (int row)
{
dataRefresh(row, true);
}
/**
* Refresh row data
* @param row index
* @param fireEvent
*/
public void dataRefresh (int row, boolean fireEvent)
{ {
log.fine("#" + m_vo.TabNo + " - row=" + row); log.fine("#" + m_vo.TabNo + " - row=" + row);
m_mTable.dataRefresh(row); m_mTable.dataRefresh(row, fireEvent);
setCurrentRow(row, true); setCurrentRow(row, fireEvent);
fireStateChangeEvent(new StateChangeEvent(this, StateChangeEvent.DATA_REFRESH)); if (fireEvent)
fireStateChangeEvent(new StateChangeEvent(this, StateChangeEvent.DATA_REFRESH));
} // dataRefresh } // dataRefresh
@ -1008,7 +1038,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
for (int i = m_window.getTabIndex(this) - 1; i >= 0; i--) { for (int i = m_window.getTabIndex(this) - 1; i >= 0; i--) {
GridTab parentTab = m_window.getTab(i); GridTab parentTab = m_window.getTab(i);
if (parentTab.m_vo.TabLevel == level-1) { if (parentTab.m_vo.TabLevel == level-1) {
parentTab.dataRefresh(); parentTab.dataRefresh(false);
// search for the next parent // search for the next parent
if (parentTab.isDetail()) { if (parentTab.isDetail()) {
level = parentTab.m_vo.TabLevel; level = parentTab.m_vo.TabLevel;
@ -1018,7 +1048,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
} }
} }
// refresh this tab // refresh this tab
dataRefresh(); dataRefresh(false);
} }
} }

View File

@ -87,6 +87,7 @@ import org.compiere.util.ValueNamePair;
public class GridTable extends AbstractTableModel public class GridTable extends AbstractTableModel
implements Serializable implements Serializable
{ {
public static final String DATA_REFRESH_MESSAGE = "Refreshed";
/** /**
* generated * generated
*/ */
@ -2738,6 +2739,16 @@ public class GridTable extends AbstractTableModel
* @param row row * @param row row
*/ */
public void dataRefresh (int row) public void dataRefresh (int row)
{
dataRefresh(row, true);
}
/**
* Refresh Row - ignore changes
* @param row row
* @param fireStatusEvent
*/
public void dataRefresh (int row, boolean fireStatusEvent)
{ {
log.info("Row=" + row); log.info("Row=" + row);
@ -2789,7 +2800,8 @@ public class GridTable extends AbstractTableModel
m_rowChanged = -1; m_rowChanged = -1;
m_inserting = false; m_inserting = false;
fireTableRowsUpdated(row, row); fireTableRowsUpdated(row, row);
fireDataStatusIEvent("Refreshed", ""); if (fireStatusEvent)
fireDataStatusIEvent(DATA_REFRESH_MESSAGE, "");
} // dataRefresh } // dataRefresh
@ -2797,6 +2809,15 @@ public class GridTable extends AbstractTableModel
* Refresh all Rows - ignore changes * Refresh all Rows - ignore changes
*/ */
public void dataRefreshAll() public void dataRefreshAll()
{
dataRefreshAll(true);
}
/**
* Refresh all Rows - ignore changes
* @param fireStatusEvent
*/
public void dataRefreshAll(boolean fireStatusEvent)
{ {
log.info(""); log.info("");
m_inserting = false; // should not happen m_inserting = false; // should not happen
@ -2809,7 +2830,8 @@ public class GridTable extends AbstractTableModel
m_rowChanged = -1; m_rowChanged = -1;
m_inserting = false; m_inserting = false;
fireTableDataChanged(); fireTableDataChanged();
fireDataStatusIEvent("Refreshed", ""); if (fireStatusEvent)
fireDataStatusIEvent(DATA_REFRESH_MESSAGE, "");
} // dataRefreshAll } // dataRefreshAll
@ -2833,7 +2855,7 @@ public class GridTable extends AbstractTableModel
m_rowChanged = -1; m_rowChanged = -1;
m_inserting = false; m_inserting = false;
fireTableDataChanged(); fireTableDataChanged();
fireDataStatusIEvent("Refreshed", ""); fireDataStatusIEvent(DATA_REFRESH_MESSAGE, "");
return true; return true;
} // dataRequery } // dataRequery

View File

@ -1009,7 +1009,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
newTabpanel.activate(true); newTabpanel.activate(true);
back = (newTabIndex < oldTabIndex); back = (newTabIndex < oldTabIndex);
if (back) if (back && newTabpanel.getTabLevel() > 0)
{ {
if (newTabpanel.getTabLevel() >= oldTabpanel.getTabLevel()) if (newTabpanel.getTabLevel() >= oldTabpanel.getTabLevel())
back = false; back = false;
@ -1129,7 +1129,8 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
{ {
sb.replace(pos, pos+1, " - "); sb.replace(pos, pos+1, " - ");
} }
boolean showPopup = e.isError() || (!GridTab.DEFAULT_STATUS_MESSAGE.equals(e.getAD_Message())); boolean showPopup = e.isError()
|| (!GridTab.DEFAULT_STATUS_MESSAGE.equals(e.getAD_Message()) && !GridTable.DATA_REFRESH_MESSAGE.equals(e.getAD_Message()));
statusBar.setStatusLine (sb.toString (), e.isError (), showPopup); statusBar.setStatusLine (sb.toString (), e.isError (), showPopup);
} }
} }
@ -1256,15 +1257,24 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
return (selTabIndex == 0); return (selTabIndex == 0);
} }
/**
* refresh all row
* @param fireEvent
*/
public void onRefresh(boolean fireEvent)
{
onSave(false);
curTab.dataRefreshAll(fireEvent);
curTabpanel.dynamicDisplay(0);
focusToActivePanel();
}
/** /**
* @see ToolbarListener#onRefresh() * @see ToolbarListener#onRefresh()
*/ */
public void onRefresh() public void onRefresh()
{ {
onSave(false); onRefresh(true);
curTab.dataRefreshAll();
curTabpanel.dynamicDisplay(0);
focusToActivePanel();
} }
/** /**
@ -1390,7 +1400,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
curTabpanel.query(m_onlyCurrentRows, m_onlyCurrentDays, MRole.getDefault().getMaxQueryRecords()); // autoSize curTabpanel.query(m_onlyCurrentRows, m_onlyCurrentDays, MRole.getDefault().getMaxQueryRecords()); // autoSize
} }
curTab.dataRefresh(); // Elaine 2008/07/25 curTab.dataRefresh(false); // Elaine 2008/07/25
} }
focusToActivePanel(); focusToActivePanel();
} }
@ -1408,7 +1418,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
else else
{ {
curTab.dataIgnore(); curTab.dataIgnore();
curTab.dataRefresh(); curTab.dataRefresh(false);
curTabpanel.dynamicDisplay(0); curTabpanel.dynamicDisplay(0);
toolbar.enableIgnore(false); toolbar.enableIgnore(false);
} }
@ -1898,7 +1908,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
if (vp.needSave()) if (vp.needSave())
{ {
onSave(false); onSave(false);
onRefresh(); onRefresh(false);
} }
} // PaymentRule } // PaymentRule
@ -1998,7 +2008,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
if (error != null) if (error != null)
FDialog.error(curWindowNo, null, "PostingError-N", error); FDialog.error(curWindowNo, null, "PostingError-N", error);
onRefresh(); onRefresh(false);
} }
} }
return; return;
@ -2043,7 +2053,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
form.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED); form.setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
form.setAttribute(Window.INSERT_POSITION_KEY, Window.INSERT_NEXT); form.setAttribute(Window.INSERT_POSITION_KEY, Window.INSERT_NEXT);
SessionManager.getAppDesktop().showWindow(form); SessionManager.getAppDesktop().showWindow(form);
onRefresh(); onRefresh(false);
} }
else else
{ {
@ -2056,8 +2066,8 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
dialog.setVisible(true); dialog.setVisible(true);
dialog.setPosition("center"); dialog.setPosition("center");
AEnv.showWindow(dialog); AEnv.showWindow(dialog);
onRefresh();
} }
onRefresh(false);
} }
} // actionButton } // actionButton
@ -2194,7 +2204,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
private void updateUI(ProcessInfo pi) { private void updateUI(ProcessInfo pi) {
// Refresh data // Refresh data
curTab.dataRefresh(); curTab.dataRefresh(false);
// Timeout // Timeout
if (pi.isTimeout()) // set temporarily to R/O if (pi.isTimeout()) // set temporarily to R/O
Env.setContext(ctx, curWindowNo, "Processed", "Y"); Env.setContext(ctx, curWindowNo, "Processed", "Y");

View File

@ -18,6 +18,7 @@
package org.adempiere.webui.panel; package org.adempiere.webui.panel;
import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.Panel;
import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.session.SessionManager;
@ -202,7 +203,7 @@ public class StatusBarPanel extends Panel implements EventListener, IStatusBar
statusLine.setStyle("color: black"); statusLine.setStyle("color: black");
statusLine.setTooltiptext(text); statusLine.setTooltiptext(text);
if (!embedded && showPopup) if (showPopup && AEnv.isBrowserSupported())
{ {
Text t = new Text(text); Text t = new Text(text);
popupContent.getChildren().clear(); popupContent.getChildren().clear();
@ -252,11 +253,13 @@ public class StatusBarPanel extends Panel implements EventListener, IStatusBar
String script = "var d = $e('" + popup.getUuid() + "');"; String script = "var d = $e('" + popup.getUuid() + "');";
script += "d.style.display='block';d.style.visibility='hidden';"; script += "d.style.display='block';d.style.visibility='hidden';";
script += "var hs = document.defaultView.getComputedStyle(d, null).getPropertyValue('height');"; script += "var dhs = document.defaultView.getComputedStyle(d, null).getPropertyValue('height');";
script += "var h = parseInt(hs, 10);"; script += "var dh = parseInt(dhs, 10);";
script += "h = h - 18;if (h < 0) h = 0;"; script += "var r = $e('" + getRoot().getUuid() + "');";
script += "var p = Position.cumulativeOffset($e('" + this.getUuid() + "'));"; script += "var rhs = document.defaultView.getComputedStyle(r, null).getPropertyValue('height');";
script += "d.style.top=(p[1]-h)+'px';"; script += "var rh = parseInt(rhs, 10);";
script += "var p = Position.cumulativeOffset(r);";
script += "d.style.top=(rh-dh-5)+'px';";
script += "d.style.left=(p[0]+1)+'px';"; script += "d.style.left=(p[0]+1)+'px';";
script += "d.style.visibility='visible';"; script += "d.style.visibility='visible';";