[richfaces-svn-commits] JBoss Rich Faces SVN: r5577 - branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Jan 23 21:11:40 EST 2008


Author: nbelaevski
Date: 2008-01-23 21:11:40 -0500 (Wed, 23 Jan 2008)
New Revision: 5577

Modified:
   branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
Log:
http://jira.jboss.com/jira/browse/RF-2021

Modified: branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js	2008-01-24 02:04:36 UTC (rev 5576)
+++ branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js	2008-01-24 02:11:40 UTC (rev 5577)
@@ -290,11 +290,10 @@
 		return data;
 	},
 	
-	evalScripts : function(node, isLast){
+	evalScripts : function(node){
 			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() {
 		        for (var i = 0; i < newscripts.length; i++){
 		          var newscript = Sarissa.getText( newscripts[i],true ) ; // TODO - Mozilla disable innerHTML in XML page ..."";
@@ -310,39 +309,16 @@
 		          	  }
 			    }
 			    newscripts = null;
-			    if (isLast)
-			    {
-			    	if(_this.onfinish){
-					_this.onfinish(_this);
-					_this=undefined;
-					}
-			    }
 			  },50);
-		    } else
-		    {
-			    if (isLast)
-			    {
-			    	if(this.onfinish){
-					this.onfinish(this);
-					}
-			    }
 		    }
 		    
 		
 	},
 	
-	beforeUpdatePagePart: function (id)
-	{
-		var oldnode = window.document.getElementById(id);
-		if ( oldnode  ) {
-			
-		}		
-	},
-	
 	/**
 	 * Update DOM element with given ID by element with same ID in parsed responseXML
 	 */
-	updatePagePart : function(id, isLast){
+	updatePagePart : function(id){
 		var newnode = this.getElementById(id);
 		if( ! newnode ) { LOG.error("New node for ID "+id+" is not present in response");return;}
 		var oldnode = window.document.getElementById(id);
@@ -375,20 +351,12 @@
 	// re-execute all script fragments in imported subtree...
 	// TODO - opera 8 run scripts at replace content stage.
 			if(!A4J.AJAX._scriptEvaluated){
-				this.evalScripts(newnode, isLast);
+				this.evalScripts(newnode);
 			}
 	        LOG.debug("Update part of page for Id: "+id + " successful");
 		} else {
 			LOG.warn("Node for replace by response with id "+id+" not found in document");
 		}
-		
-		if (A4J.AJAX._scriptEvaluated && isLast)
-	    {
-	    	if(this.onfinish){
-			this.onfinish(this);
-			}
-	    }
-		
 	},
 	
 	appendNewHeadElements : function(){
@@ -814,7 +782,7 @@
 	        	  	req.appendNewHeadElements();
 					for ( var k =0; k < options.affected.length ; k++ ) {
 						LOG.debug("Update page part from call parameter for ID " + options.affected[k]);
-						req.updatePagePart(options.affected[k], k==options.affected.length-1);
+						req.updatePagePart(options.affected[k]);
 					};
 		// if resopnce contains element with ID "ajax:update" get id's from
 		// child text element . like :
@@ -831,7 +799,7 @@
 	        	for ( var k=0 ; k < childs.length ; k++ ) {
 	        		var id = childs[k];
 	        		LOG.debug("Attempt to update part of page for Id: "+id);
-					if ( id ) {req.updatePagePart(id, k==childs.length-1);};
+					if ( id ) {req.updatePagePart(id);};
 				};
         	  } else {
         			// if none of above - error ?




More information about the richfaces-svn-commits mailing list