You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2007/03/05 23:38:00 UTC

svn commit: r514897 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/ajax/api/ theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ theme/standard/src/main/resources/org/apache/myfac...

Author: bommel
Date: Mon Mar  5 14:38:00 2007
New Revision: 514897

URL: http://svn.apache.org/viewvc?view=rev&rev=514897
Log:
(TOBAGO-302) Can ' t find Overlay after ajax request in IE

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PanelRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
    myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
    myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java?view=diff&rev=514897&r1=514896&r2=514897
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxPhaseListener.java Mon Mar  5 14:38:00 2007
@@ -57,6 +57,7 @@
   public static final String CODE_SUCCESS = "<status code=\"200\"/>";
   public static final String CODE_NOT_MODIFIED = "<status code=\"304\"/>";
   public static final String CODE_RELOAD_REQUIRED = "<status code=\"309\"/>";
+  public static final String TOBAGO_AJAX_STATUS_CODE = "org.apache.myfaces.tobago.StatusCode";
 
   public static Object getValueForComponent(
       FacesContext facesContext, UIComponent component) {
@@ -155,8 +156,11 @@
       LOG.debug("Size of AjaxResponse:\n" + buf.length()
           + " = 0x" + Integer.toHexString(buf.length()));
     }
-
-    buf.insert(0, CODE_SUCCESS);
+    if (facesContext.getExternalContext().getRequestMap().containsKey(TOBAGO_AJAX_STATUS_CODE)) {
+      buf.insert(0, facesContext.getExternalContext().getRequestMap().get(TOBAGO_AJAX_STATUS_CODE));
+    } else {
+      buf.insert(0, CODE_SUCCESS);
+    }
 
     buf.insert(0, Integer.toHexString(buf.length()) + "\r\n");
     buf.append("\r\n" + 0 + "\r\n\r\n");

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PanelRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PanelRenderer.java?view=diff&rev=514897&r1=514896&r2=514897
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PanelRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PanelRenderer.java Mon Mar  5 14:38:00 2007
@@ -44,7 +44,6 @@
 import javax.faces.component.UINamingContainer;
 import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseWriter;
-import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 
 public class PanelRenderer extends RendererBase implements AjaxRenderer {
@@ -168,11 +167,11 @@
         update = reload.getUpdate();
       }
     }
-    if (update || !(facesContext.getExternalContext().getResponse() instanceof HttpServletResponse)) {
+    if (update) {
       component.encodeChildren(facesContext);
     } else {
-      HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
-      response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
+      facesContext.getExternalContext().getRequestMap().put(AjaxPhaseListener.TOBAGO_AJAX_STATUS_CODE,
+          AjaxPhaseListener.CODE_NOT_MODIFIED);
     }
     facesContext.responseComplete();
   }

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java?view=diff&rev=514897&r1=514896&r2=514897
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java Mon Mar  5 14:38:00 2007
@@ -93,7 +93,6 @@
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseWriter;
-import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.text.MessageFormat;
 import java.util.ArrayList;
@@ -1097,11 +1096,11 @@
         update = reload.getUpdate();
       }
     }
-    if (update || !(facesContext.getExternalContext().getResponse() instanceof HttpServletResponse)) {
+    if (update) {
       renderSheet(facesContext, (UIData) component);
     } else {
-      HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
-      response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
+      facesContext.getExternalContext().getRequestMap().put(AjaxPhaseListener.TOBAGO_AJAX_STATUS_CODE, 
+          AjaxPhaseListener.CODE_NOT_MODIFIED);
     }
     facesContext.responseComplete();
   }

Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?view=diff&rev=514897&r1=514896&r2=514897
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Mon Mar  5 14:38:00 2007
@@ -316,7 +316,7 @@
 
 Tobago.Sheet.prototype.onFailure = function() {
   Tobago.deleteOverlay(Tobago.element(this.outerDivId));
-  this.initReload();  
+  this.initReload();
 };
 
 Tobago.Sheet.prototype.setupResizer = function() {
@@ -346,6 +346,7 @@
     if (divElement.skipUpdate) {
         LOG.debug("skip setup");
         divElement.skipUpdate = false;
+        Tobago.deleteOverlay(Tobago.element(this.outerDivId));
     } else {
 
       // ToDo: find a better way to fix this problem

Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?view=diff&rev=514897&r1=514896&r2=514897
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Mon Mar  5 14:38:00 2007
@@ -1692,11 +1692,11 @@
         receiver.skipUpdate = true;
       } else if (response.substring(0, Tobago.Updater.CODE_NOT_MODIFIED.length) == Tobago.Updater.CODE_NOT_MODIFIED) {
         // no update needed, do nothing
-              LOG.debug("skip update");
+        LOG.debug("skip update");
         receiver.skipUpdate = true;
       } else if (response.substring(0, Tobago.Updater.CODE_SUCCESS.length) == Tobago.Updater.CODE_SUCCESS) {
         // update content
-              LOG.debug("update content");
+        LOG.debug("update content");
         Element.update(receiver, response.substring(20));
       } else if (response.substring(0, Tobago.Updater.CODE_RELOAD_REQUIRED.length) == Tobago.Updater.CODE_RELOAD_REQUIRED) {
         // reload complete page