[ http://issues.apache.org/jira/browse/PB-6?page=comments#action_12322843 ]
Ronald Holshausen commented on PB-6:
------------------------------------
After the previous change, the screen works fine (including using tiles), but
failes as soon as a form is added. The exception is:
java.lang.IllegalStateException: Must be a RenderResponse
at
org.apache.portals.bridges.jsf.PortletViewHandlerImpl.getActionURL(PortletViewHandlerImpl.java:103)
at
org.apache.shale.clay.faces.ClayViewHandler.getActionURL(ClayViewHandler.java:143)
at
org.apache.shale.faces.ShaleViewHandler.getActionURL(ShaleViewHandler.java:129)
at
org.apache.shale.tiles.TilesViewHandler.getActionURL(TilesViewHandler.java:217)
at
org.apache.myfaces.renderkit.html.HtmlFormRendererBase.encodeBegin(HtmlFormRendererBase.java:91)
....
Looking at PortletViewHandlerImpl.java:103, I see that it throws an exception
if it does not recieve a RenderResponse. I modified it to delegate to the
default view handler if it doesn't get a RenderResponse, amd this works.
------------------------ Changed Code ---------------------------------------
/*if (!(response instanceof RenderResponse))
{
throw new IllegalStateException("Must be a RenderResponse");
}*/
if (response instanceof RenderResponse)
{
RenderResponse renderResponse = (RenderResponse) response;
PortletURL actionURL = renderResponse.createActionURL();
return (actionURL.toString());
}
else
{
return handler.getActionURL(facesContext, viewId);
}
> Opening new JSF windows from the portlet edit page causes the new window to
> fail with an error
> ----------------------------------------------------------------------------------------------
>
> Key: PB-6
> URL: http://issues.apache.org/jira/browse/PB-6
> Project: Portals Bridges
> Type: Bug
> Components: jsf
> Versions: 0.3
> Environment: Windows XP, Tomcat 5.5.9, Jetspeed 2.0-M3, MyFaces 1.09
> Reporter: Ronald Holshausen
>
> I have included a button on the porlet edit page that opens a new JSF window
> via window.open javascript. The window opens but failed to render with an
> 'Unsupported context type ' error.
> Class file: org.apache.portals.bridges.jsf.FacesContextFactoryImpl
> Line: 58
> Looking at the code for FacesContextFactoryImpl, I see that it only accepts
> context objects of type PortletConfig, but the popup window recieves a
> ServletContext instead as it is running outside the portlet enviroment.
> As a temporary work around, I modified FacesContextFactoryImpl based on the
> FacesContextFactoryImpl from myfaces, which checks for both a PortletConfig
> and ServletContext, and added myfaces as a dependancy. This compiles and
> works fine.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]