You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Martin Koci (JIRA)" <de...@myfaces.apache.org> on 2010/06/18 12:57:28 UTC

[jira] Created: (MYFACES-2761) PartialViewContextImpl does not respect isRenderAll()

PartialViewContextImpl does not respect isRenderAll()
-----------------------------------------------------

                 Key: MYFACES-2761
                 URL: https://issues.apache.org/jira/browse/MYFACES-2761
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-314
    Affects Versions: 2.0.2-SNAPSHOT
         Environment: myfaces current trunk
            Reporter: Martin Koci


This construct should lead to complete ajax re-render of whole view (works with mojarra):

partialViewContext.setRenderAll(true);

but it seems that myfaces don't read property renderAll during rendering at all. Probably org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialRendering(UIViewRoot, PhaseId) should respect this property somehow. Note: there is a possible workaround:

partialViewContext.getRenderIds().add(javax.faces.context.PartialResponseWriter.RENDER_ALL_MARKER);



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (MYFACES-2761) PartialViewContextImpl does not respect isRenderAll()

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-2761.
-------------------------------------

    Fix Version/s: 2.0.1-SNAPSHOT
       Resolution: Fixed

After MYFACES-2801 we can close this issue

> PartialViewContextImpl does not respect isRenderAll()
> -----------------------------------------------------
>
>                 Key: MYFACES-2761
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2761
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces current trunk
>            Reporter: Martin Kočí
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.1-SNAPSHOT
>
>
> This construct should lead to complete ajax re-render of whole view (works with mojarra):
> partialViewContext.setRenderAll(true);
> but it seems that myfaces don't read property renderAll during rendering at all. Probably org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialRendering(UIViewRoot, PhaseId) should respect this property somehow. Note: there is a possible workaround:
> partialViewContext.getRenderIds().add(javax.faces.context.PartialResponseWriter.RENDER_ALL_MARKER);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (MYFACES-2761) PartialViewContextImpl does not respect isRenderAll()

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883948#action_12883948 ] 

Werner Punz edited comment on MYFACES-2761 at 6/30/10 4:43 PM:
---------------------------------------------------------------

Ok I committed the changes, scripts are now properly evaled even if placed in the head. The downside is, the page must be properly xhtml that this works html 4.01 is out of the game now.
(normal in - body ppr cases still should work on html 4.01 though)

I personally think this is a minor downside since facelets enforces xhtml 1.0+ anyway.



      was (Author: werpu):
    Ok I am working on a solution, I am also going to drop the interpreter in favor of browser based parsing, which is a tad slower but easier to maintain.
(The interpreter had a bug and it is hard to maintain anyway, so I am going to drop it)

The crux of this is, I wont be able to finish it today. Maybe tomorrow I will check everything in.

  
> PartialViewContextImpl does not respect isRenderAll()
> -----------------------------------------------------
>
>                 Key: MYFACES-2761
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2761
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces current trunk
>            Reporter: Martin Kočí
>            Assignee: Leonardo Uribe
>
> This construct should lead to complete ajax re-render of whole view (works with mojarra):
> partialViewContext.setRenderAll(true);
> but it seems that myfaces don't read property renderAll during rendering at all. Probably org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialRendering(UIViewRoot, PhaseId) should respect this property somehow. Note: there is a possible workaround:
> partialViewContext.getRenderIds().add(javax.faces.context.PartialResponseWriter.RENDER_ALL_MARKER);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2761) PartialViewContextImpl does not respect isRenderAll()

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883685#action_12883685 ] 

Leonardo Uribe commented on MYFACES-2761:
-----------------------------------------

Ok, I see. Thanks for the clarification.

I tested the algorithm we have and it is doing right, it tries to find <body> tags and replace everything inside this tag, no matter if the whole document is sent on the update. So I think on the server we can first check if a HtmlBody child is found inside UIViewRoot, if that so just call encodeAll on it, otherwise, call it for all UIViewRoot children.

> PartialViewContextImpl does not respect isRenderAll()
> -----------------------------------------------------
>
>                 Key: MYFACES-2761
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2761
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces current trunk
>            Reporter: Martin Kočí
>            Assignee: Leonardo Uribe
>
> This construct should lead to complete ajax re-render of whole view (works with mojarra):
> partialViewContext.setRenderAll(true);
> but it seems that myfaces don't read property renderAll during rendering at all. Probably org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialRendering(UIViewRoot, PhaseId) should respect this property somehow. Note: there is a possible workaround:
> partialViewContext.getRenderIds().add(javax.faces.context.PartialResponseWriter.RENDER_ALL_MARKER);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2761) PartialViewContextImpl does not respect isRenderAll()

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883798#action_12883798 ] 

Werner Punz commented on MYFACES-2761:
--------------------------------------

Ok I will change our script behavior then regarding embedded scripts for render all...
We should be identical to mojarra in the behavior.



> PartialViewContextImpl does not respect isRenderAll()
> -----------------------------------------------------
>
>                 Key: MYFACES-2761
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2761
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces current trunk
>            Reporter: Martin Kočí
>            Assignee: Leonardo Uribe
>
> This construct should lead to complete ajax re-render of whole view (works with mojarra):
> partialViewContext.setRenderAll(true);
> but it seems that myfaces don't read property renderAll during rendering at all. Probably org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialRendering(UIViewRoot, PhaseId) should respect this property somehow. Note: there is a possible workaround:
> partialViewContext.getRenderIds().add(javax.faces.context.PartialResponseWriter.RENDER_ALL_MARKER);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2761) PartialViewContextImpl does not respect isRenderAll()

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883439#action_12883439 ] 

Werner Punz commented on MYFACES-2761:
--------------------------------------

Just to comment something additional to this issue. During the script implementation it has shown that neither render all nor render head works out.
The issue was that certain browsers based on the Webkit engine prohibit a <head> replacement (body replacement works fine for certain conditions)
On the script side, I discussed that with the mojarra people and we agreed not to implement render head for now and limit render all to the body only client side. (I have not checked if mojarra still behaves like that)
In the end the spec leaves it up to the implementation what has to be done in that case, which was a last minute change to tackle the problem on the spec side.

You can issue the full page however, we have a high performance ll parser which strips out the body in the render all case and only does body replacement.
If you issue a render head on the client side the script will trigger a non supported error however, for now.

So anything regarding render all on the server side is safe and only cause the body to be rendered, no matter if the entire html form is issued or just the body. (including the body tags, which are the only must)




> PartialViewContextImpl does not respect isRenderAll()
> -----------------------------------------------------
>
>                 Key: MYFACES-2761
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2761
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces current trunk
>            Reporter: Martin Kočí
>            Assignee: Leonardo Uribe
>
> This construct should lead to complete ajax re-render of whole view (works with mojarra):
> partialViewContext.setRenderAll(true);
> but it seems that myfaces don't read property renderAll during rendering at all. Probably org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialRendering(UIViewRoot, PhaseId) should respect this property somehow. Note: there is a possible workaround:
> partialViewContext.getRenderIds().add(javax.faces.context.PartialResponseWriter.RENDER_ALL_MARKER);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2761) PartialViewContextImpl does not respect isRenderAll()

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883359#action_12883359 ] 

Leonardo Uribe commented on MYFACES-2761:
-----------------------------------------

Yes, we are not calling isRenderAll() from any location, instead, we rely on getRenderIds() to check if we need to render all or not.

Reviewing the javadoc, it seems we are using "javax.faces.ViewRoot" string directly instead PartialResponseWriter.RENDER_ALL_MARKER.

We have this code for renderAll:

        java.util.Iterator<UIComponent> iter = viewRoot.getFacetsAndChildren();
        writer.startUpdate ("javax.faces.ViewRoot");
        while (iter.hasNext()) 
        { 
            UIComponent comp = iter.next();
            
            if (comp instanceof javax.faces.component.html.HtmlBody)
            {
                comp.encodeAll (_facesContext);
            }
        }
        writer.endUpdate();  

check for a specific instance in the component tree is not a good solution. If the intention is to update only everything inside <body> tag, we should check this condition on the javascript side. The reason is it could be possible to override the default implementation and use another tag that does not necessary extends from HtmlBody class. Examples for this problem is <tr:document> (yes, trinidad override everything so in that case it will work) and t:documentBody.

In theory it should be also possible to add additional component resources inside <head> tag.

I'll commit a fix for this one, but we need to think in more detail this stuff, so I'll let it open until check the code.

> PartialViewContextImpl does not respect isRenderAll()
> -----------------------------------------------------
>
>                 Key: MYFACES-2761
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2761
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces current trunk
>            Reporter: Martin Kočí
>
> This construct should lead to complete ajax re-render of whole view (works with mojarra):
> partialViewContext.setRenderAll(true);
> but it seems that myfaces don't read property renderAll during rendering at all. Probably org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialRendering(UIViewRoot, PhaseId) should respect this property somehow. Note: there is a possible workaround:
> partialViewContext.getRenderIds().add(javax.faces.context.PartialResponseWriter.RENDER_ALL_MARKER);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2761) PartialViewContextImpl does not respect isRenderAll()

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883720#action_12883720 ] 

Werner Punz commented on MYFACES-2761:
--------------------------------------

Hia Leonardo, I would call UIViewRoot in render=all nevertheless, there are browsers where it works (Firefox)
theoretically a render all replaces everything including head tags.
That the scripts only rerender the body is a pure client side issue.

That the client for now has to ignore it (unless I find a way around the head issues on webkit and co) should not affect the server code in that area. A user might implement his own solution if he knows which browsers he can limit his code.




> PartialViewContextImpl does not respect isRenderAll()
> -----------------------------------------------------
>
>                 Key: MYFACES-2761
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2761
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces current trunk
>            Reporter: Martin Kočí
>            Assignee: Leonardo Uribe
>
> This construct should lead to complete ajax re-render of whole view (works with mojarra):
> partialViewContext.setRenderAll(true);
> but it seems that myfaces don't read property renderAll during rendering at all. Probably org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialRendering(UIViewRoot, PhaseId) should respect this property somehow. Note: there is a possible workaround:
> partialViewContext.getRenderIds().add(javax.faces.context.PartialResponseWriter.RENDER_ALL_MARKER);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2761) PartialViewContextImpl does not respect isRenderAll()

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885366#action_12885366 ] 

Leonardo Uribe commented on MYFACES-2761:
-----------------------------------------

Checking some stuff related to our ResponseWriter implementation, I note that it is true facelets enforces xhtml 1.0, but the response content is always text/html, because IE does not parse xhtml responses.

Maybe a solution using the previous parser is better. In theory, we just have to extract the scripts from the returned head and evaluate one by one. But I don't see how the content inside <head> tag could be ill-formed. If that so, facelets fail first because it uses a SAX parser and if the document has an error like that, it could not be parsed. So in conclusion I think we are ok with the proposed solution.

> PartialViewContextImpl does not respect isRenderAll()
> -----------------------------------------------------
>
>                 Key: MYFACES-2761
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2761
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces current trunk
>            Reporter: Martin Kočí
>            Assignee: Leonardo Uribe
>
> This construct should lead to complete ajax re-render of whole view (works with mojarra):
> partialViewContext.setRenderAll(true);
> but it seems that myfaces don't read property renderAll during rendering at all. Probably org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialRendering(UIViewRoot, PhaseId) should respect this property somehow. Note: there is a possible workaround:
> partialViewContext.getRenderIds().add(javax.faces.context.PartialResponseWriter.RENDER_ALL_MARKER);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2761) PartialViewContextImpl does not respect isRenderAll()

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883782#action_12883782 ] 

Leonardo Uribe commented on MYFACES-2761:
-----------------------------------------

Ok, so the best from the server side is just call encodeAll on all children. I'll commit that behavior.

Testing what ri does in this case, when render=all is sent, all scripts, including the ones inside <head> tag are evaluated. That causes jsf.js to be loaded again, but does not replace the content inside <head> tag.

The code on the server side does not do nothing when it is founded javax.faces.ViewHead or javax.faces.ViewBody as render ids.

> PartialViewContextImpl does not respect isRenderAll()
> -----------------------------------------------------
>
>                 Key: MYFACES-2761
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2761
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces current trunk
>            Reporter: Martin Kočí
>            Assignee: Leonardo Uribe
>
> This construct should lead to complete ajax re-render of whole view (works with mojarra):
> partialViewContext.setRenderAll(true);
> but it seems that myfaces don't read property renderAll during rendering at all. Probably org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialRendering(UIViewRoot, PhaseId) should respect this property somehow. Note: there is a possible workaround:
> partialViewContext.getRenderIds().add(javax.faces.context.PartialResponseWriter.RENDER_ALL_MARKER);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2761) PartialViewContextImpl does not respect isRenderAll()

Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883948#action_12883948 ] 

Werner Punz commented on MYFACES-2761:
--------------------------------------

Ok I am working on a solution, I am also going to drop the interpreter in favor of browser based parsing, which is a tad slower but easier to maintain.
(The interpreter had a bug and it is hard to maintain anyway, so I am going to drop it)

The crux of this is, I wont be able to finish it today. Maybe tomorrow I will check everything in.


> PartialViewContextImpl does not respect isRenderAll()
> -----------------------------------------------------
>
>                 Key: MYFACES-2761
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2761
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.2-SNAPSHOT
>         Environment: myfaces current trunk
>            Reporter: Martin Kočí
>            Assignee: Leonardo Uribe
>
> This construct should lead to complete ajax re-render of whole view (works with mojarra):
> partialViewContext.setRenderAll(true);
> but it seems that myfaces don't read property renderAll during rendering at all. Probably org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialRendering(UIViewRoot, PhaseId) should respect this property somehow. Note: there is a possible workaround:
> partialViewContext.getRenderIds().add(javax.faces.context.PartialResponseWriter.RENDER_ALL_MARKER);

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.