From c9255259cb0b5fab8c1f8fb9b43475b29bbb48c7 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 14 Nov 2013 16:58:57 +0800 Subject: [PATCH 1/2] IDEMPIERE-1442 Additional confirmation on close and void action. Apply IsConfirmOnVoid flag to reversal as well. --- .../src/org/adempiere/webui/panel/WDocActionPanel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java index cb3b723598..f89cfb4b5e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/WDocActionPanel.java @@ -311,7 +311,9 @@ public class WDocActionPanel extends Window implements EventListener, Dia { String selected = lstDocAction.getSelectedItem().getValue().toString(); if((selected.equals(org.compiere.process.DocAction.ACTION_Close) && clientInfo.isConfirmOnDocClose()) - || (selected.equals(org.compiere.process.DocAction.ACTION_Void) && clientInfo.isConfirmOnDocVoid())) + || (selected.equals(org.compiere.process.DocAction.ACTION_Void) && clientInfo.isConfirmOnDocVoid()) + || (selected.equals(org.compiere.process.DocAction.ACTION_Reverse_Accrual) && clientInfo.isConfirmOnDocVoid()) + || (selected.equals(org.compiere.process.DocAction.ACTION_Reverse_Correct) && clientInfo.isConfirmOnDocVoid())) { String docAction = lstDocAction.getSelectedItem().getLabel(); MessageFormat mf = new MessageFormat(Msg.getMsg(Env.getAD_Language(Env.getCtx()), "ConfirmOnDocAction")); From 6ab722f2375a3729237d491bfbf2bf3d2f481045 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 15 Nov 2013 16:24:22 +0800 Subject: [PATCH 2/2] IDEMPIERE-1149 Implements SetFocus on field. Shouldn't set initial focus to detail tab. --- .../adempiere/webui/adwindow/ADTabpanel.java | 2 +- .../adempiere/webui/adwindow/GridView.java | 28 +++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index b27ed361c0..f41fbb00f8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -1410,7 +1410,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer @Override public void focus() { - if (formContainer.isVisible()) + if (form.isVisible()) this.focusToFirstEditor(true); else listPanel.focus(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java index f6aa691d8d..c6c987825f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java @@ -730,7 +730,7 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi setFocusToField(columnOnClick); columnOnClick = null; } else { - renderer.focusToFirstEditor(); + focusToFirstEditorIfNotDetailTab(); } } else { focusToRow(row); @@ -761,6 +761,30 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi } } + private void focusToFirstEditorIfNotDetailTab() { + ADTabpanel adtabpanel = null; + boolean setFocus = true; + Component parent = listbox.getParent(); + while (parent != null) { + if (parent instanceof ADTabpanel) { + adtabpanel = (ADTabpanel) parent; + break; + } + parent = parent.getParent(); + } + if (adtabpanel != null) + { + ADWindow adwindow = ADWindow.findADWindow(adtabpanel); + if (adwindow != null) { + IADTabpanel selectedADTabpanel = adwindow.getADWindowContent().getADTab().getSelectedTabpanel(); + if (selectedADTabpanel != adtabpanel) + setFocus = false; + } + } + if (setFocus) + renderer.focusToFirstEditor(); + } + /** * scroll grid to the current focus row */ @@ -774,7 +798,7 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi setFocusToField(columnOnClick); columnOnClick = null; } else { - renderer.focusToFirstEditor(); + focusToFirstEditorIfNotDetailTab(); } } else { Component cmp = null;