Fix [ adempiere-ZK Web Client-2603630 ] Rerunning process must be implemented as optional

https://sourceforge.net/tracker2/?func=detail&atid=955896&aid=2603630&group_id=176962
This commit is contained in:
Carlos Ruiz 2009-02-16 01:06:57 +00:00
parent 6a05943ead
commit 64dfa6acf8
1 changed files with 9 additions and 21 deletions

View File

@ -305,10 +305,10 @@ public class ProcessDialog extends Window implements EventListener//, ASyncProce
if (component instanceof Button) { if (component instanceof Button) {
Button element = (Button)component; Button element = (Button)component;
if ("Ok".equalsIgnoreCase(element.getId())) { if ("Ok".equalsIgnoreCase(element.getId())) {
if (!isResult) if (element.getLabel().length() > 0)
this.startProcess(); this.startProcess();
else else
restart(); this.dispose();
} else if ("Cancel".equalsIgnoreCase(element.getId())) { } else if ("Cancel".equalsIgnoreCase(element.getId())) {
this.dispose(); this.dispose();
} }
@ -379,38 +379,26 @@ public class ProcessDialog extends Window implements EventListener//, ASyncProce
m_messageText.append(pi.getLogInfo(true)); m_messageText.append(pi.getLogInfo(true));
message.setContent(m_messageText.toString()); message.setContent(m_messageText.toString());
bOK.setLabel(Msg.getMsg(Env.getCtx(), "Parameter")); bOK.setLabel("");
bOK.setImage("/images/Reset16.png");
isResult = true;
m_ids = pi.getIDs(); m_ids = pi.getIDs();
//no longer needed, hide to give more space to display log //no longer needed, hide to give more space to display log
centerPanel.setVisible(false); centerPanel.detach();
invalidate(); invalidate();
Clients.response(new AuEcho(this, "onAfterProcess", null)); Clients.response(new AuEcho(this, "onAfterProcess", null));
} }
private void restart() {
m_messageText = new StringBuffer(initialMessage);
message.setContent(initialMessage);
centerPanel.setVisible(true);
isResult = false;
bOK.setLabel(Msg.getMsg(Env.getCtx(), "Start"));
bOK.setImage("/images/Ok16.png");
invalidate();
}
public void onAfterProcess() public void onAfterProcess()
{ {
// //
afterProcessTask(); afterProcessTask();
// Close automatically
if (m_IsReport && !m_pi.isError())
this.dispose();
// If the process is a silent one and no errors occured, close the dialog // If the process is a silent one and no errors occured, close the dialog
if(m_ShowHelp != null && m_ShowHelp.equals("S")) if(m_ShowHelp != null && m_ShowHelp.equals("S"))
this.dispose(); this.dispose();