From c721b256b2bf99483413e401d22144a8af84fda9 Mon Sep 17 00:00:00 2001 From: Musachy Barroso Date: Sat, 9 Jun 2007 23:17:28 +0000 Subject: [PATCH] Fix form autodiscover for bind tags git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@545813 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/struts2/static/dojo/struts/widget/Bind.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js index 8da9148ae..bb9af8f56 100644 --- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js +++ b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js @@ -107,8 +107,8 @@ dojo.widget.defineWidget( } } - if(dojo.string.isBlank(this.href) && dojo.string.isBlank(this.formId)) { - //no href and no formId, we must be inside a form + if(dojo.string.isBlank(this.formId)) { + //no formId, see if we are inside a form this.formNode = dojo.dom.getFirstAncestorByTag(this.domNode, "form"); } else { this.formNode = dojo.byId(this.formId); @@ -117,10 +117,6 @@ dojo.widget.defineWidget( if(this.formNode && dojo.string.isBlank(this.href)) { this.href = this.formNode.action; } - - if(!dojo.string.isBlank(this.formId)) { - this.formNode = dojo.byId(this.formId); - } }, highlight : function() {