From 9884a406b6429c17b30a1d350b3dce02543f392d Mon Sep 17 00:00:00 2001 From: Lawrence Carvalho Date: Thu, 12 Mar 2009 10:19:07 +0000 Subject: [PATCH] Merged 3.1 to HEAD 13305: fix for ETHREEOH-911 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13588 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/web/scripts/ajax/xforms.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/source/web/scripts/ajax/xforms.js b/source/web/scripts/ajax/xforms.js index 248eb3ab5a..679334f4b7 100644 --- a/source/web/scripts/ajax/xforms.js +++ b/source/web/scripts/ajax/xforms.js @@ -337,11 +337,27 @@ alfresco.xforms.Widget = new Class({ } else { + var getNodeText = function(xmlNode) + { + if(xmlNode) + { + if (xmlNode.firstChild) + { + return (typeof(xmlNode.textContent) != "undefined") ? xmlNode.textContent : xmlNode.firstChild.nodeValue; + } + else + { + return (typeof(xmlNode.textContent) != "undefined") ? xmlNode.textContent : xmlNode.nodeValue; + } + } + return ''; + } + this._initialValue = (this._initialValue.nodeType == document.ELEMENT_NODE ? (this._initialValue.firstChild - ? this._initialValue.firstChild.nodeValue + ? getNodeText(this._initialValue) : null) - : this._initialValue.nodeValue); + : getNodeText(this._initialValue)); if (typeof this._initialValue == "string" && this._initialValue.length == 0) { this._initialValue = null;