From c0c394d7669359908930a507de26d2ef0e3a18c0 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 21 Mar 2013 14:30:11 +0800 Subject: [PATCH] IDEMPIERE-786 ZK: Remove onFocus and onBlur server side event for field editor. Fixed problem with ; character. --- .../src/org/adempiere/webui/adwindow/ADTabpanel.java | 2 +- .../org/adempiere/webui/adwindow/GridTabRowRenderer.java | 2 +- .../src/org/adempiere/webui/panel/HelpController.java | 6 +++--- 3 files changed, 5 insertions(+), 5 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 ff25945b69..5718813d94 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 @@ -530,7 +530,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer editor.getComponent().setWidgetOverride("fieldHeader", HelpController.escapeJavascriptContent(field.getHeader())); editor.getComponent().setWidgetOverride("fieldDescription", HelpController.escapeJavascriptContent(field.getDescription())); editor.getComponent().setWidgetOverride("fieldHelp", HelpController.escapeJavascriptContent(field.getHelp())); - editor.getComponent().setWidgetListener("onFocus", "zWatch.fire('onFieldTooltip', this, null, this.fieldHeader, this.fieldDescription, this.fieldHelp);"); + editor.getComponent().setWidgetListener("onFocus", "zWatch.fire('onFieldTooltip', this, null, this.fieldHeader(), this.fieldDescription(), this.fieldHelp());"); editor.getComponent().setWidgetListener("onBlur", "zWatch.fire('onFieldTooltip', this);"); editor.setGridTab(this.getGridTab()); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java index e592eaed97..ca302e7522 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java @@ -381,7 +381,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt editor.getComponent().setWidgetOverride("fieldHeader", HelpController.escapeJavascriptContent(gridPanelFields[i].getHeader())); editor.getComponent().setWidgetOverride("fieldDescription", HelpController.escapeJavascriptContent(gridPanelFields[i].getDescription())); editor.getComponent().setWidgetOverride("fieldHelp", HelpController.escapeJavascriptContent(gridPanelFields[i].getHelp())); - editor.getComponent().setWidgetListener("onFocus", "zWatch.fire('onFieldTooltip', this, null, this.fieldHeader, this.fieldDescription, this.fieldHelp);"); + editor.getComponent().setWidgetListener("onFocus", "zWatch.fire('onFieldTooltip', this, null, this.fieldHeader(), this.fieldDescription(), this.fieldHelp());"); editor.getComponent().setWidgetListener("onBlur", "zWatch.fire('onFieldTooltip', this);"); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HelpController.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HelpController.java index 99ac18daaf..f0bb4c7c5e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HelpController.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/HelpController.java @@ -444,9 +444,9 @@ public class HelpController { // If the content is null, then return '' if (content == null) - return "''"; + return "function(){return '';}"; // - StringBuilder out = new StringBuilder("'"); + StringBuilder out = new StringBuilder("function(){return '"); char[] chars = content.toCharArray(); for (int i = 0; i < chars.length; i++) { @@ -468,7 +468,7 @@ public class HelpController break; } } - out.append("'"); + out.append("';}"); return out.toString(); } // maskHTML }