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 528339cbfe..ebb2d6d2d2 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 @@ -481,6 +481,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements { setActiveTab(gridWindow.getTabIndex(gTab), null); gTab.navigate(i); + if (gc.isGridView()) + gc.switchRowPresentation(); return true; } } 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 f7eb985a47..369a9e5f8c 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 @@ -255,7 +255,7 @@ public class CompositeADTabbox extends AbstractADTabbox return; IADTabpanel tabPanel = (IADTabpanel) event.getTarget(); - if (tabPanel != headerTab) { + if (tabPanel != headerTab && headerTab.getDetailPane() != null) { if (b != null && b.booleanValue()) { onActivateDetail(tabPanel); } 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 792bc30f93..5d38646913 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 @@ -46,6 +46,7 @@ import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Cell; import org.zkoss.zul.Column; import org.zkoss.zul.Div; import org.zkoss.zul.Frozen; @@ -632,11 +633,8 @@ public class GridView extends Vbox implements EventListener, IdSpace Component c = (Component) o; if (!c.isVisible()) continue; - c = c.getFirstChild(); - if (c == null) - continue; - if (c.getNextSibling() != null) { - cmp = c.getNextSibling(); + if (c instanceof Cell) { + cmp = c; break; } } diff --git a/org.adempiere.ui.zk/js/layout.js b/org.adempiere.ui.zk/js/layout.js index 48aa141cce..da1f09f66d 100644 --- a/org.adempiere.ui.zk/js/layout.js +++ b/org.adempiere.ui.zk/js/layout.js @@ -1,25 +1,41 @@ function ad_deferRenderBorderLayout(uuid, timeout) { - var meta = zk.Widget.$(uuid); - if (meta) { - setTimeout("_ad_deferBDL('"+uuid+"')", timeout); + try { + var meta = zk.Widget.$(uuid); + if (meta) { + setTimeout("_ad_deferBDL('"+uuid+"')", timeout); + } + } catch (err) { + if (console) console.log(err); } } -function _ad_deferBDL(uuid) { - var cmp = zk.Widget.$(uuid); - if (cmp) { cmp.resize(); } +function _ad_deferBDL(uuid) { + try { + var cmp = zk.Widget.$(uuid); + if (cmp) { cmp.resize(); } + } catch (err) { + if (console) console.log(err); + } } function _ad_closeBuble(link) { - var parent = link.parentsUntil("simileAjax-bubble-contentContainer"); - var btn = parent.next(); - btn.click(); + try { + var parent = link.parentsUntil("simileAjax-bubble-contentContainer"); + var btn = parent.next(); + btn.click(); + } catch (err) { + if (console) console.log(err); + } } -function scrollToRow(uuid){ - var cmp = zk.Widget.$(uuid); - if (cmp) { - cmp.scrollIntoView(); - cmp.focus(); - } +function scrollToRow(uuid){ + try { + var cmp = zk.Widget.$(uuid); + if (cmp) { + cmp.scrollIntoView(); + cmp.focus(); + } + } catch (err) { + if (console) console.log(err); + } }