Author: pete.muir(a)jboss.org
Date: 2008-02-26 13:12:58 -0500 (Tue, 26 Feb 2008)
New Revision: 7485
Modified:
trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java
trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java
trunk/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java
Log:
JBSEAM-2665 - thanks to Keith Naas!
Modified:
trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java
===================================================================
---
trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java 2008-02-26
18:02:30 UTC (rev 7484)
+++
trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/CommandButtonParameterRendererBase.java 2008-02-26
18:12:58 UTC (rev 7485)
@@ -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:
trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java
===================================================================
---
trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java 2008-02-26
18:02:30 UTC (rev 7484)
+++
trunk/ui/src/main/java/org/jboss/seam/ui/renderkit/DefaultActionRendererBase.java 2008-02-26
18:12:58 UTC (rev 7485)
@@ -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: trunk/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java 2008-02-26
18:02:30 UTC (rev 7484)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/util/cdk/RendererUtils.java 2008-02-26
18:12:58 UTC (rev 7485)
@@ -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)