[jboss-cvs] jboss-seam/src/remoting/org/jboss/seam/remoting ...

Shane Bryzak sbryzak at redhat.com
Sun Aug 26 23:00:58 EDT 2007


  User: sbryzak2
  Date: 07/08/26 23:00:58

  Modified:    src/remoting/org/jboss/seam/remoting  remote.js
  Log:
  fixed variable undefined errors when page goes out of scope
  
  Revision  Changes    Path
  1.9       +12 -4     jboss-seam/src/remoting/org/jboss/seam/remoting/remote.js
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: remote.js
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/remoting/org/jboss/seam/remoting/remote.js,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- remote.js	23 Aug 2007 07:45:22 -0000	1.8
  +++ remote.js	27 Aug 2007 03:00:58 -0000	1.9
  @@ -617,8 +617,10 @@
     else
       asyncReq = new ActiveXObject("Microsoft.XMLHTTP");
   
  +  var rcb = Seam.Remoting.requestCallback;
  +  
     asyncReq.onreadystatechange = function() {
  -    if (Seam) Seam.Remoting.requestCallback(asyncReq, callback);     
  +    if (rcb) rcb(asyncReq, callback);     
     }
   
     if (Seam.Remoting.encodedSessionId)
  @@ -640,12 +642,14 @@
   {
     if (req.readyState == 4)
     {
  -    Seam.Remoting.hideLoadingMessage();
  +    var inScope = typeof(Seam) == "undefined" ? false : true;
  +    
  +    if (inScope) Seam.Remoting.hideLoadingMessage();
       req.onreadystatechange = function() {};
   
       if (req.status == 200)
       {
  -      Seam.Remoting.log("Response packet:\n" + req.responseText);
  +      if (inScope) Seam.Remoting.log("Response packet:\n" + req.responseText);
   
         if (callback)
           callback(req.responseXML);
  @@ -659,6 +663,10 @@
   {
     var headerNode;
     var bodyNode;
  +
  +  var inScope = typeof(Seam) == "undefined" ? false : true;
  +  if (!inScope) return;    
  +  
     var context = new Seam.Remoting.__Context;
   
     if (doc.documentElement)
  @@ -685,7 +693,7 @@
           break;
         }
       }
  -    if (contextNode)
  +    if (contextNode && context)
       {
         Seam.Remoting.unmarshalContext(contextNode, context);
         if (context.getConversationId() && Seam.Remoting.getContext().getConversationId() == null)
  
  
  



More information about the jboss-cvs-commits mailing list