WW-1951 Ajax submit button executeScripts="true" evaluates javascript before DOM elements are defined

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@543927 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Musachy Barroso
2007-06-03 16:14:32 +00:00
parent be0b15a774
commit 32298bc001
3 changed files with 32 additions and 16 deletions
@@ -190,10 +190,14 @@ dojo.widget.defineWidget(
// 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);
@@ -13698,8 +13698,8 @@ return;
}
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 @@ this.comboBoxSelectionValue.value=obj[1].toString();
},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.setValue(obj[0].toString());
this.comboBoxSelectionValue.value=obj[1].toString();
}
}
}else{
this.comboBoxSelectionValue.value=text;
}
},getSelectedValue:function(){
return this.comboBoxValue.value;
},getText:function(){
@@ -17753,7 +17757,7 @@ if(this.beforeSelectTabNotifyTopicsArray){
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 @@ if(this.afterSelectTabNotifyTopicsArray){
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);
@@ -22242,10 +22242,14 @@ dojo.widget.defineWidget(
// 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 @@ dojo.widget.defineWidget(
},
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 @@ dojo.widget.defineWidget(
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 @@ dojo.widget.defineWidget(
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);
}