You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (Updated) (JIRA)" <de...@myfaces.apache.org> on 2011/10/22 19:25:32 UTC

[jira] [Updated] (MYFACES-3367) Detect when to wpdate head or body target when content has been updated dynamically

     [ https://issues.apache.org/jira/browse/MYFACES-3367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe updated MYFACES-3367:
------------------------------------

    Status: Patch Available  (was: Open)
    
> Detect when to wpdate head or body target when content has been updated dynamically
> -----------------------------------------------------------------------------------
>
>                 Key: MYFACES-3367
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3367
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>         Attachments: MYFACES-3367-1.patch
>
>
> Related to topic sent on jsr344-experts list:
> [jsr344-experts] Facelet page with dynamic content and update ajax content does not work as user expects
> Now take a look at this example:
> include.xhtml
> <h:commandLink ...>
>    <f:ajax render="content"/>
> </h:commandLink>
> ...
> <f:subview id="content">
> <ui:include src="#{testManagedBean.page}"/>
> </f:subview>
> page1.xhtml
> <ui:composition
>     xmlns:h="http://java.sun.com/jsf/html"
>     xmlns:f="http://java.sun.com/jsf/core"
>     xmlns:ui="http://java.sun.com/jsf/facelets">
> <h:outputText id="component1" value="Page 1"/>
> <!-- ... more components ... -->
> </ui:composition>
> page2.xhtml
> <ui:composition
>     xmlns:h="http://java.sun.com/jsf/html"
>     xmlns:f="http://java.sun.com/jsf/core"
>     xmlns:ui="http://java.sun.com/jsf/facelets">
> <h:outputStylesheet ... />
> <h:outputText id="component2" value="Page 2"/>
> <!-- ... more components ... -->
> </ui:composition>
> Here the problem is if the dynamic content changes and add a resource under
> "head" target (h:outputStylesheet does that), shouldn't be added a section
> on the ajax payload to update the <head> section? In theory yes, because
> this breaks encapsulation principle. If the user says render all inside
> content if the <head> section changes it is responsability of the framework
> (in this case PartialViewContext) to detect that an send the correct
> payload, right?. Here we have two options:
> a. Keep track of the resources rendered and save that on the state, then use
> that information to check if the head should be rendered. 
> b. Use PostAddToViewEvent to check when a change on the component tree has 
> triggered a change on the head.
> Option b. save some bytes on the state but it could cause render <head> 
> section more than necessary (for example a dynamic change but the head
> has already rendered the resource, so it is not necessary). Option a.
> impose that you need a way to check if the <head> was changed, and
> require changes on the spec. 
> I'll solve this problem adding a web config param:
> org.apache.myfaces.STRICT_JSF_2_REFRESH_TARGET_AJAX
>  on MyFaces and doing some
> changes on the algorithm, adding a flag to indicate if a view is being built
> by first time. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira