From af64d567f614fca4eaf5db87f85d84e549408f61 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Tue, 20 Oct 2009 15:03:33 +0000 Subject: [PATCH] Merged V3.2 to HEAD 17053: Merged V3.1 to V3.2 17052: Merged V2.2 to V3.1 17050: Fix for layout issues in ETWOTWO-490: xf:switch cannot be used in repeating field type git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17055 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/web/scripts/ajax/xforms.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/source/web/scripts/ajax/xforms.js b/source/web/scripts/ajax/xforms.js index 8b358d081a..101d5e5a90 100644 --- a/source/web/scripts/ajax/xforms.js +++ b/source/web/scripts/ajax/xforms.js @@ -3105,14 +3105,12 @@ alfresco.xforms.SwitchGroup = alfresco.xforms.VGroup.extend({ _insertChildAt: function(child, position) { var childDomContainer = this.parent(child, position); + if (child.id == this._selectedCaseId) { this._getCaseToggleTriggerByCaseId(this._selectedCaseId).fire(); } - else - { - childDomContainer.style.display = "none"; - } + return childDomContainer; }, @@ -4145,6 +4143,21 @@ alfresco.xforms.XForm = new Class({ " is a prototype, ignoring"); continue; } + + // fix for ETWOTWO-490, hide elements after rendering + if (xformsNode.childNodes[i].nodeName == "chiba:data" && + parentWidget instanceof alfresco.xforms.SwitchGroup) + { + var selectedCase = parentWidget._selectedCaseId; + for (var x = 0; x < parentWidget._children.length; x++) + { + if (parentWidget._children[x].id != selectedCase) + { + parentWidget._children[x].domContainer.style.display = "none"; + } + } + } + var w = this.createWidget(xformsNode.childNodes[i]); if (w != null) {