diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 0145c8519e..f07d5d2ff6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -1526,6 +1526,18 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements toolbar.enableIgnore(true); toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted()); toolbar.enableReport(true); + if (adTabbox.getSelectedGridTab().isSingleRow()) + { + if (adTabbox.getSelectedTabpanel().isGridView()) + { + adTabbox.getSelectedTabpanel().switchRowPresentation(); + } + } + + if (adTabbox.getSelectedTabpanel().isGridView()) + { + adTabbox.getSelectedTabpanel().getGridView().editCurrentRow(); + } } else { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java index 6e94047fd2..ff3ef4c2ee 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java @@ -108,9 +108,16 @@ public class CompositeADTabbox extends AbstractADTabbox @Override public void onCallback(Boolean result) { if (result) { - onEditDetail(row, true); - if (!adWindowPanel.getActiveGridTab().isNew()) - adWindowPanel.onNew(); + if (getSelectedDetailADTabpanel().getGridTab().isSingleRow()) { + onEditDetail(row, true); + if (!adWindowPanel.getActiveGridTab().isNew()) + adWindowPanel.onNew(); + } else { + if (!getSelectedDetailADTabpanel().getGridTab().isNew()) { + getSelectedDetailADTabpanel().getGridTab().dataNew(false); + getSelectedDetailADTabpanel().getGridView().editCurrentRow(); + } + } } } }); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java index c8798b88f0..135e2ceb48 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java @@ -232,7 +232,7 @@ public class DetailPane extends Panel implements EventListener, IdSpace { } } if (adtab != null && adtab.isDetailPaneMode()) { - onEdit(false); + onEdit(adtab.getGridTab().isSingleRow()); } } }); 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 c8a6d4353b..87b6cd987f 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 @@ -820,4 +820,11 @@ public class GridView extends Vbox implements EventListener, IdSpace public GridField[] getFields() { return gridField; } + + public void editCurrentRow() { + if (!renderer.isEditing()) { + renderer.editCurrentRow(); + renderer.setFocusToEditor(); + } + } }