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 (Created) (JIRA)" <de...@myfaces.apache.org> on 2011/10/22 19:23:32 UTC
[jira] [Created] (MYFACES-3367) Detect when to wpdate head or body
target when content has been updated dynamically
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
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
[jira] [Commented] (MYFACES-3367) Detect when to wpdate head or
body target when content has been updated dynamically
Posted by "Leonardo Uribe (Commented) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13206263#comment-13206263 ]
Leonardo Uribe commented on MYFACES-3367:
-----------------------------------------
Hi
Checking this part, it works on 2.0.11 but stopped working on 2.0.12. I don't know yet the reason, it should work, I'll take a look at it.
Leonardo
> 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
> Fix For: 2.0.10, 2.1.4
>
> 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
[jira] [Updated] (MYFACES-3367) Detect when to wpdate head or body
target when content has been updated dynamically
Posted by "Leonardo Uribe (Updated) (JIRA)" <de...@myfaces.apache.org>.
[ 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
[jira] [Commented] (MYFACES-3367) Detect when to wpdate head or
body target when content has been updated dynamically
Posted by "Luciano Deriu (Commented) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13206245#comment-13206245 ]
Luciano Deriu commented on MYFACES-3367:
----------------------------------------
Hi Leonardo,
Has this code been checked into a release yet? I've tried the latest build (2.0.12) and it still doesn't work.
Thanks
Luciano
> 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
> Fix For: 2.0.10, 2.1.4
>
> 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
[jira] [Updated] (MYFACES-3367) Detect when to wpdate head or body
target when content has been updated dynamically
Posted by "Leonardo Uribe (Updated) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leonardo Uribe updated MYFACES-3367:
------------------------------------
Resolution: Fixed
Fix Version/s: 2.1.4
2.0.10
Status: Resolved (was: Patch Available)
> 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
> Fix For: 2.0.10, 2.1.4
>
> 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
[jira] [Commented] (MYFACES-3367) Detect when to wpdate head or
body target when content has been updated dynamically
Posted by "Leonardo Uribe (Commented) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13133442#comment-13133442 ]
Leonardo Uribe commented on MYFACES-3367:
-----------------------------------------
If no objection I'll commit this code soon.
> 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