You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bridges-dev@portals.apache.org by "Ronald Holshausen (JIRA)" <br...@portals.apache.org> on 2005/11/16 14:06:27 UTC

[jira] Created: (PB-32) FacesPortlet does not invoke createView if restoreView returns null

FacesPortlet does not invoke createView if restoreView returns null
-------------------------------------------------------------------

         Key: PB-32
         URL: http://issues.apache.org/jira/browse/PB-32
     Project: Portals Bridges
        Type: Bug
  Components: jsf  
    Versions: 0.4    
 Environment: Ubuntu linux 5.10, JDK 1.5.0_05, Tomcat 5.5.12, Jetspeed 2.0-M4, MyFaces 1.1.1, Struts Shale
    Reporter: Ronald Holshausen


During handling of a render request, the FacesPortlet calls restoreView on the view handler, but not createView if the restoreView returns null. This is causing the Shale view controllers not to be invoked when there is no view stored in the session (for instance the first time the portlet is invoked).

The following change to FacesPortlet line 453 resolves this:
//                context.getApplication().getViewHandler().restoreView(context, vi);
                ViewHandler viewHandler = context.getApplication().getViewHandler();
                UIViewRoot view = viewHandler.restoreView(context, vi);
                if (view == null)
                {
                  view = viewHandler.createView(context, vi);
                  view.setViewId(vi);
                  context.renderResponse();
                }


-- 
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: bridges-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: bridges-dev-help@portals.apache.org


[jira] Commented: (PB-32) FacesPortlet does not invoke createView if restoreView returns null

Posted by "Ronald Holshausen (JIRA)" <br...@portals.apache.org>.
    [ http://issues.apache.org/jira/browse/PB-32?page=comments#action_12357800 ] 

Ronald Holshausen commented on PB-32:
-------------------------------------

After some further investigation, I have discovered why the restoreView always returns null. This has to do with the ActionRequest being sent through first before the RenderRequest. During the handling of the ActionRequest, the faces lifecycle is invoked, which includes the restore view phase. The default action of the restoreView of the myfaces jsp view handler is to remove the session variable after restoring the view. Thus, when the RenderRequest is received, the serialised view has already been removed.

> FacesPortlet does not invoke createView if restoreView returns null
> -------------------------------------------------------------------
>
>          Key: PB-32
>          URL: http://issues.apache.org/jira/browse/PB-32
>      Project: Portals Bridges
>         Type: Bug
>   Components: jsf
>     Versions: 0.4
>  Environment: Ubuntu linux 5.10, JDK 1.5.0_05, Tomcat 5.5.12, Jetspeed 2.0-M4, MyFaces 1.1.1, Struts Shale
>     Reporter: Ronald Holshausen

>
> During handling of a render request, the FacesPortlet calls restoreView on the view handler, but not createView if the restoreView returns null. This is causing the Shale view controllers not to be invoked when there is no view stored in the session (for instance the first time the portlet is invoked).
> The following change to FacesPortlet line 453 resolves this:
> //                context.getApplication().getViewHandler().restoreView(context, vi);
>                 ViewHandler viewHandler = context.getApplication().getViewHandler();
>                 UIViewRoot view = viewHandler.restoreView(context, vi);
>                 if (view == null)
>                 {
>                   view = viewHandler.createView(context, vi);
>                   view.setViewId(vi);
>                   context.renderResponse();
>                 }

-- 
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: bridges-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: bridges-dev-help@portals.apache.org


[jira] Commented: (PB-32) FacesPortlet does not invoke createView if restoreView returns null

Posted by "Ronald Holshausen (JIRA)" <br...@portals.apache.org>.
    [ http://issues.apache.org/jira/browse/PB-32?page=comments#action_12357811 ] 

Ronald Holshausen commented on PB-32:
-------------------------------------

I see that the in the block that handles the ActionRequest, the viewroot is saved to portlet session, but it is never restored anywhere. Changing lines 444-5 to the following resolves this:
                //request.getPortletSession().setAttribute(createViewRootKey(context, defaultPage, viewId), context.getViewRoot());
                //ActionResponse actionResponse = (ActionResponse)response;
                
                // save the view again so it will be restored during the handling of the render request 
                context.getApplication().getStateManager().saveSerializedView(context);

> FacesPortlet does not invoke createView if restoreView returns null
> -------------------------------------------------------------------
>
>          Key: PB-32
>          URL: http://issues.apache.org/jira/browse/PB-32
>      Project: Portals Bridges
>         Type: Bug
>   Components: jsf
>     Versions: 0.4
>  Environment: Ubuntu linux 5.10, JDK 1.5.0_05, Tomcat 5.5.12, Jetspeed 2.0-M4, MyFaces 1.1.1, Struts Shale
>     Reporter: Ronald Holshausen

>
> During handling of a render request, the FacesPortlet calls restoreView on the view handler, but not createView if the restoreView returns null. This is causing the Shale view controllers not to be invoked when there is no view stored in the session (for instance the first time the portlet is invoked).
> The following change to FacesPortlet line 453 resolves this:
> //                context.getApplication().getViewHandler().restoreView(context, vi);
>                 ViewHandler viewHandler = context.getApplication().getViewHandler();
>                 UIViewRoot view = viewHandler.restoreView(context, vi);
>                 if (view == null)
>                 {
>                   view = viewHandler.createView(context, vi);
>                   view.setViewId(vi);
>                   context.renderResponse();
>                 }

-- 
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: bridges-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: bridges-dev-help@portals.apache.org