Author: nbelaevski
Date: 2008-03-11 21:55:27 -0400 (Tue, 11 Mar 2008)
New Revision: 6729
Modified:
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
http://jira.jboss.com/jira/browse/RF-1487
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-03-12 00:07:21 UTC
(rev 6728)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-03-12 01:55:27 UTC
(rev 6729)
@@ -295,8 +295,8 @@
var newscripts = this.getElementsByTagName("script",node);
LOG.debug("Scripts in updated part count : " + newscripts.length);
if( newscripts.length > 0 ){
- var _this = this;
- window.setTimeout(function() {
+ var _this = this;
+ window.setTimeout(function() {
for (var i = 0; i < newscripts.length; i++){
var newscript = Sarissa.getText( newscripts[i],true ) ; // TODO - Mozilla
disable innerHTML in XML page ..."";
try {
@@ -313,23 +313,17 @@
newscripts = null;
if (isLast)
{
- if(_this.onfinish){
- _this.onfinish(_this);
- _this=undefined;
- }
+ _this.doFinish();
+ _this = undefined;
}
- },50);
+ }, 50);
} else
{
if (isLast)
{
- if(this.onfinish){
- this.onfinish(this);
- }
+ this.doFinish();
}
}
-
-
},
beforeUpdatePagePart: function (id)
@@ -385,13 +379,17 @@
if (A4J.AJAX._scriptEvaluated && isLast)
{
- if(this.onfinish){
- this.onfinish(this);
- }
+ this.doFinish()
}
},
+ doFinish: function() {
+ if(this.onfinish){
+ this.onfinish(this);
+ }
+ },
+
appendNewHeadElements : function(){
// Append scripts and styles to head, if not presented in page before.
this._appendNewElements("script","src",null,null,["type","language","charset"]);
@@ -838,6 +836,7 @@
// if none of above - error ?
// A4J.AJAX.replace(form.id,A4J.AJAX.findElement(form.id,xmlDoc));
LOG.warn("No information in response about elements to replace");
+ req.doFinish();
}
// Replace client-side hidden inputs for JSF View state.
var idsSpan = req.getElementById("ajax-view-state");