diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/UiLifeCycleListener.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/UiLifeCycleListener.java
new file mode 100644
index 0000000000..3fccc337d3
--- /dev/null
+++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/UiLifeCycleListener.java
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * Copyright (C) 2013 Heng Sin Low *
+ * Copyright (C) 2013 Trek Global *
+ * This program is free software; you can redistribute it and/or modify it *
+ * under the terms version 2 of the GNU General Public License as published *
+ * by the Free Software Foundation. This program is distributed in the hope *
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
+ * See the GNU General Public License for more details. *
+ * You should have received a copy of the GNU General Public License along *
+ * with this program; if not, write to the Free Software Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
+ *****************************************************************************/
+package org.adempiere.webui;
+
+import org.zkoss.zk.ui.Component;
+import org.zkoss.zk.ui.Desktop;
+import org.zkoss.zk.ui.Page;
+import org.zkoss.zk.ui.util.UiLifeCycle;
+
+/**
+ * @author hengsin
+ *
+ */
+public class UiLifeCycleListener implements UiLifeCycle {
+
+ /**
+ *
+ */
+ public UiLifeCycleListener() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.zkoss.zk.ui.util.UiLifeCycle#afterComponentAttached(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Page)
+ */
+ @Override
+ public void afterComponentAttached(Component comp, Page page) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.zkoss.zk.ui.util.UiLifeCycle#afterComponentDetached(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Page)
+ */
+ @Override
+ public void afterComponentDetached(Component comp, Page prevpage) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.zkoss.zk.ui.util.UiLifeCycle#afterComponentMoved(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
+ */
+ @Override
+ public void afterComponentMoved(Component parent, Component child, Component prevparent) {
+ String locator = child.getWidgetAttribute(AdempiereIdGenerator.ZK_LOCATOR_ATTRIBUTE);
+ if (locator != null) {
+ AdempiereIdGenerator.updateZkLocatorAttribute(child);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.zkoss.zk.ui.util.UiLifeCycle#afterPageAttached(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Desktop)
+ */
+ @Override
+ public void afterPageAttached(Page page, Desktop desktop) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.zkoss.zk.ui.util.UiLifeCycle#afterPageDetached(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Desktop)
+ */
+ @Override
+ public void afterPageDetached(Page page, Desktop prevdesktop) {
+ }
+
+}
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 3a9155495a..7b2bcd9284 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
@@ -26,6 +26,7 @@ import java.util.Map.Entry;
import java.util.logging.Level;
import org.adempiere.base.Core;
+import org.adempiere.webui.AdempiereIdGenerator;
import org.adempiere.webui.AdempiereWebUI;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Borderlayout;
@@ -247,7 +248,7 @@ DataStatusListener, IADTabpanel, IdSpace
this.getChildren().clear();
- setId(gridTab.getName());
+ setId(AdempiereIdGenerator.escapeId(gridTab.getName()));
int AD_Tree_ID = 0;
if (gridTab.isTreeTab())
diff --git a/org.adempiere.ui.zk/WEB-INF/zk-selenium.xml b/org.adempiere.ui.zk/WEB-INF/zk-selenium.xml
index 06f7e9ea8f..c9df6be923 100644
--- a/org.adempiere.ui.zk/WEB-INF/zk-selenium.xml
+++ b/org.adempiere.ui.zk/WEB-INF/zk-selenium.xml
@@ -10,6 +10,10 @@
org.adempiere.webui.AdempiereIdGenerator
+
+ org.adempiere.webui.UiLifeCycleListener
+
+
org.zkoss.zk.ui.uuidRecycle.disabled
diff --git a/org.idempiere.ui.zk.selenium/src/fitlibrary/zk/ZkFixture.java b/org.idempiere.ui.zk.selenium/src/fitlibrary/zk/ZkFixture.java
index 167074ed84..095f6b8eef 100644
--- a/org.idempiere.ui.zk.selenium/src/fitlibrary/zk/ZkFixture.java
+++ b/org.idempiere.ui.zk.selenium/src/fitlibrary/zk/ZkFixture.java
@@ -191,6 +191,11 @@ public class ZkFixture extends SpiderFixture {
}
}
+ public void focus(String locator) {
+ Widget widget = new Widget(locator);
+ widget.execute(webDriver, "focus()");
+ }
+
protected String getEval(String script) {
return String.valueOf(executeJavaScript("return ("+ script+");"));
}