myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r513504 - in /myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController: AbstractViewControllerExecutor.java ReflectiveViewControllerExecutor.java ViewController.java ViewControllerPhaseListener.java
Date Thu, 01 Mar 2007 23:25:45 GMT
Author: werpu
Date: Thu Mar  1 13:19:00 2007
New Revision: 513504

URL: http://svn.apache.org/viewvc?view=rev&rev=513504
Log:
added invoke apply request values added

Modified:
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/AbstractViewControllerExecutor.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ReflectiveViewControllerExecutor.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewController.java
    myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerPhaseListener.java

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/AbstractViewControllerExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/AbstractViewControllerExecutor.java?view=diff&rev=513504&r1=513503&r2=513504
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/AbstractViewControllerExecutor.java
(original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/AbstractViewControllerExecutor.java
Thu Mar  1 13:19:00 2007
@@ -35,4 +35,9 @@
 	public void invokePreRenderView(Object bean)
 	{
 	}
+    
+    public void invokePostApplyRequestValues(Object bean)
+    {
+        
+    }
 }

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ReflectiveViewControllerExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ReflectiveViewControllerExecutor.java?view=diff&rev=513504&r1=513503&r2=513504
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ReflectiveViewControllerExecutor.java
(original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ReflectiveViewControllerExecutor.java
Thu Mar  1 13:19:00 2007
@@ -67,4 +67,28 @@
 			throw new FacesException(e);
 		}
 	}
+
+    
+    public void invokePostApplyRequestValues(Object bean) {
+        try
+        {
+            Method method = bean.getClass().getMethod("postApplyRequest", null); // NON-NLS
+            method.invoke(bean, null);
+        }
+        catch (NoSuchMethodException e)
+        {
+            // no problem
+            // just ignore it
+        }
+        catch (IllegalAccessException e)
+        {
+            throw new FacesException(e);
+        }
+        catch (InvocationTargetException e)
+        {
+            throw new FacesException(e);
+        }
+    }
+    
+    
 }

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewController.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewController.java?view=diff&rev=513504&r1=513503&r2=513504
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewController.java
(original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewController.java
Thu Mar  1 13:19:00 2007
@@ -31,5 +31,7 @@
 {
 	public void initView();
 
+    public void invokePostApplyRequestValues();
+    
 	public void preRenderView();
 }

Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerPhaseListener.java?view=diff&rev=513504&r1=513503&r2=513504
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerPhaseListener.java
(original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/ViewControllerPhaseListener.java
Thu Mar  1 13:19:00 2007
@@ -45,8 +45,13 @@
 		{
 			postRestoreView(event.getFacesContext());
 		}
-	}
 
+        if (PhaseId.APPLY_REQUEST_VALUES.equals(event.getPhaseId()))
+        {
+            postApplyRequestValues(event.getFacesContext());
+        }
+    }
+    
 	public PhaseId getPhaseId()
 	{
 		return PhaseId.ANY_PHASE;
@@ -103,4 +108,25 @@
 			manager.getViewControllerExecutor().invokeInitView(viewController);
 		}
 	}
+    
+    protected void postApplyRequestValues(FacesContext facesContext) {
+        ViewControllerManager manager = _ViewControllerUtils.getViewControllerManager(facesContext);
+        if (manager == null)
+        {
+            return;
+        }
+
+        String viewId = getViewId(facesContext);
+        if (viewId == null)
+        {
+            return;
+        }
+
+        Object viewController = manager.getViewController(facesContext, viewId);
+        if (viewController != null)
+        {
+            manager.getViewControllerExecutor().invokePostApplyRequestValues(viewController);
+        }
+        
+    }
 }



Mime
View raw message