You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by de...@apache.org on 2006/08/31 09:03:47 UTC

svn commit: r438823 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java

Author: dennisbyrne
Date: Thu Aug 31 00:03:46 2006
New Revision: 438823

URL: http://svn.apache.org/viewvc?rev=438823&view=rev
Log:
TOMAHAWK-644, reported by "Tim"

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java?rev=438823&r1=438822&r2=438823&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java Thu Aug 31 00:03:46 2006
@@ -21,6 +21,7 @@
  * @version $Revision$ $Date$
  */
 
+import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 import javax.faces.event.PhaseEvent;
 import javax.faces.event.PhaseId;
@@ -49,10 +50,14 @@
     public void afterPhase(PhaseEvent event)
     {
         FacesContext facesContext = event.getFacesContext();
-        String viewId = facesContext.getViewRoot().getViewId();
-        if (viewId != null)
+        UIViewRoot view = facesContext.getViewRoot();
+        if(view != null)
         {
-            JavascriptUtils.setOldViewId(facesContext.getExternalContext(), viewId);
+            String viewId = view.getViewId();
+            if (viewId != null)
+            {
+                JavascriptUtils.setOldViewId(facesContext.getExternalContext(), viewId);
+            }   
         }
     }