myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r365710 - in /incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago: ajax/api/AjaxUtils.java component/UIViewRoot.java
Date Tue, 03 Jan 2006 18:50:24 GMT
Author: weber
Date: Tue Jan  3 10:50:19 2006
New Revision: 365710

URL: http://svn.apache.org/viewcvs?rev=365710&view=rev
Log:
working on ajax lifecycle

Modified:
    incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
    incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java

Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java?rev=365710&r1=365709&r2=365710&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
(original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
Tue Jan  3 10:50:19 2006
@@ -3,10 +3,12 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.tobago.component.ComponentUtil;
+import org.apache.myfaces.tobago.component.UIViewRoot;
 
 import javax.faces.application.ViewHandler;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseId;
 import javax.faces.render.Renderer;
 import java.io.IOException;
 import java.util.Iterator;
@@ -104,17 +106,20 @@
       throws IOException {
 
     if (component instanceof AjaxComponent) {
+      final UIViewRoot viewRoot = (UIViewRoot) facesContext.getViewRoot();
 
       // TODO: handle phaseListeners ??
 
       component.processValidators(facesContext);
+      viewRoot.broadcastEventsForPhase(facesContext, PhaseId.PROCESS_VALIDATIONS);
 
       if (! facesContext.getRenderResponse()) {
         component.processUpdates(facesContext);
+        viewRoot.broadcastEventsForPhase(facesContext, PhaseId.UPDATE_MODEL_VALUES);
       }
 
       if (! facesContext.getRenderResponse()) {
-        facesContext.getViewRoot().processApplication(facesContext);
+        viewRoot.processApplication(facesContext);
       }
 
       ((AjaxComponent)component).encodeAjax(facesContext);

Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java?rev=365710&r1=365709&r2=365710&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java
(original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java
Tue Jan  3 10:50:19 2006
@@ -76,8 +76,14 @@
 //    LOG.info("updateRendererCachePrefix :" + rendererCachePrefix);
   }
 
-
-
+  public void broadcastEventsForPhase(FacesContext context, PhaseId phaseId) {
+    _broadcastForPhase(phaseId);
+    if (context.getRenderResponse() || context.getResponseComplete())
+    {
+        clearEvents();
+    }
+  }
+  
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 //



Mime
View raw message