Author: musachy Date: Sun Jun 3 09:14:32 2007 New Revision: 543927 URL: http://svn.apache.org/viewvc?view=rev&rev=543927 Log: WW-1951 Ajax submit button executeScripts="true" evaluates javascript before DOM elements are defined
Modified: struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js.uncompressed.js Modified: struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js?view=diff&rev=543927&r1=543926&r2=543927 ============================================================================== --- struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js (original) +++ struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js Sun Jun 3 09:14:32 2007 @@ -190,10 +190,14 @@ // no validation or validation passed if(this.executeScripts) { - //update targets content + //parse text to extract content and javascript var parsed = this.parse(data); - this._executeScripts(parsed.scripts); + + //update targets content this.setContent(parsed.text); + + //execute scripts + this._executeScripts(parsed.scripts); } else { this.setContent(data); Modified: struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js?view=diff&rev=543927&r1=543926&r2=543927 ============================================================================== --- struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js (original) +++ struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js Sun Jun 3 09:14:32 2007 @@ -13698,8 +13698,8 @@ } if(this.executeScripts){ var _b87=this.parse(data); -this._executeScripts(_b87.scripts); this.setContent(_b87.text); +this._executeScripts(_b87.scripts); }else{ this.setContent(data); } @@ -15179,6 +15179,7 @@ },getSelectedKey:function(){ return this.comboBoxSelectionValue.value; },setSelectedValue:function(text){ +if(this.dataProvider){ var data=this.dataProvider.data; for(element in data){ var obj=data[element]; @@ -15187,6 +15188,9 @@ this.comboBoxSelectionValue.value=obj[1].toString(); } } +}else{ +this.comboBoxSelectionValue.value=text; +} },getSelectedValue:function(){ return this.comboBoxValue.value; },getText:function(){ @@ -17753,7 +17757,7 @@ var self=this; dojo.lang.forEach(this.beforeSelectTabNotifyTopicsArray,function(_ebb){ try{ -dojo.event.topic.publish(_ebb,self,tab,_eb9); +dojo.event.topic.publish(_ebb,_eb9,tab,self); } catch(ex){ dojo.debug(ex); @@ -17766,7 +17770,7 @@ var self=this; dojo.lang.forEach(this.afterSelectTabNotifyTopicsArray,function(_ebc){ try{ -dojo.event.topic.publish(_ebc,self,tab,_eb9); +dojo.event.topic.publish(_ebc,tab,self); } catch(ex){ dojo.debug(ex); Modified: struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js.uncompressed.js URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js.uncompressed.js?view=diff&rev=543927&r1=543926&r2=543927 ============================================================================== --- struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js.uncompressed.js (original) +++ struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts_dojo.js.uncompressed.js Sun Jun 3 09:14:32 2007 @@ -22242,10 +22242,14 @@ // no validation or validation passed if(this.executeScripts) { - //update targets content + //parse text to extract content and javascript var parsed = this.parse(data); - this._executeScripts(parsed.scripts); + + //update targets content this.setContent(parsed.text); + + //execute scripts + this._executeScripts(parsed.scripts); } else { this.setContent(data); @@ -24618,13 +24622,17 @@ }, setSelectedValue : function(text) { - var data = this.dataProvider.data; - for(element in data) { - var obj = data[element]; - if(obj[0].toString() == text) { - this.setValue(obj[0].toString()); - this.comboBoxSelectionValue.value = obj[1].toString(); - } + if(this.dataProvider) { + var data = this.dataProvider.data; + for(element in data) { + var obj = data[element]; + if(obj[0].toString() == text) { + this.setValue(obj[0].toString()); + this.comboBoxSelectionValue.value = obj[1].toString(); + } + } + } else { + this.comboBoxSelectionValue.value = text; } }, @@ -28902,7 +28910,7 @@ var self = this; dojo.lang.forEach(this.beforeSelectTabNotifyTopicsArray, function(topic) { try { - dojo.event.topic.publish(topic, self, tab, cancel); + dojo.event.topic.publish(topic, cancel, tab, self); } catch(ex){ dojo.debug(ex); } @@ -28916,7 +28924,7 @@ var self = this; dojo.lang.forEach(this.afterSelectTabNotifyTopicsArray, function(topic) { try { - dojo.event.topic.publish(topic, self, tab, cancel); + dojo.event.topic.publish(topic, tab, self); } catch(ex){ dojo.debug(ex); }