[seam-commits] Seam SVN: r7486 - in branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui: util/cdk and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Feb 26 13:20:15 EST 2008


Author: pete.muir at jboss.org
Date: 2008-02-26 13:20:14 -0500 (Tue, 26 Feb 2008)
New Revision: 7486

Modified:
   branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java
   branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java
   branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java
Log:
Backport r7485, JBSEAM-2665, thanks to Keith Naas!

Modified: branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java
===================================================================
--- branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java	2008-02-26 18:12:58 UTC (rev 7485)
+++ branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java	2008-02-26 18:20:14 UTC (rev 7486)
@@ -9,7 +9,6 @@
 import java.io.IOException;
 
 import javax.faces.component.UIComponent;
-import javax.faces.component.UIForm;
 import javax.faces.component.UIParameter;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
@@ -35,7 +34,7 @@
    {
       UIComponent actionComponent = component.getParent();
       String actionComponentId = actionComponent.getClientId(context); 
-      UIForm form = getUtils().getForm(actionComponent);
+      UIComponent form = getUtils().getForm(actionComponent);
       UIParameter parameter = (UIParameter) component;
       if (getUtils().isCommandButton(actionComponent))
       { 

Modified: branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java
===================================================================
--- branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java	2008-02-26 18:12:58 UTC (rev 7485)
+++ branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java	2008-02-26 18:20:14 UTC (rev 7486)
@@ -9,7 +9,6 @@
 import java.io.IOException;
 
 import javax.faces.component.UIComponent;
-import javax.faces.component.UIForm;
 import javax.faces.component.UIOutput;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
@@ -37,7 +36,7 @@
    {
       UIComponent actionComponent = component.getParent();
       String actionComponentId = actionComponent.getClientId(context); 
-      UIForm form = getUtils().getForm(actionComponent);
+      UIComponent form = getUtils().getForm(actionComponent);
       if (form == null)
       {
          log.warn("Must embed default action inside a form");

Modified: branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java
===================================================================
--- branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java	2008-02-26 18:12:58 UTC (rev 7485)
+++ branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java	2008-02-26 18:20:14 UTC (rev 7486)
@@ -34,8 +34,12 @@
    private static final String TRINIDAD_FORM_FAMILY = "org.apache.myfaces.trinidad.Form";
    private static final String TRINIDAD_COMMANDBUTTON_CLASS = "org.apache.myfaces.trinidad.component.core.nav.CoreCommandButton";
    private static final String RICHFACES_COMMANDBUTTON_CLASS = "org.ajax4jsf.component.UIAjaxCommandButton";
-	
-   public UIForm getForm(UIComponent component) 
+
+   /**
+    * Since Trinidad, and possibly other JSF implementations don't always subclass
+    * from {@link javax.faces.component.UIForm} we can't cast to UIForm.
+    */
+   public UIComponent getForm(UIComponent component) 
    {
        while (component != null) 
        {
@@ -45,7 +49,7 @@
           }
           component = component.getParent();
        }
-       return (UIForm) component;
+       return component;
    }
    
    public boolean isCommandButton(UIComponent cmp)




More information about the seam-commits mailing list