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 (JIRA)" <de...@myfaces.apache.org> on 2010/02/02 04:38:19 UTC

[jira] Reopened: (MYFACES-2483) Find a way to allow c:if work with partial state saving enabled

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

Leonardo Uribe reopened MYFACES-2483:
-------------------------------------


Just as a reference note, I moved and renamed the param org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS to MyfacesConfig class on shared.

Playing a little with partial state saving algorithm, and re-reading the arguments about this problem, it was found that in most cases (c:if toogle) it is not necessary to restore the tree exactly like it was on the latest request, or in other words should remain stable between requests. The advantage is this is faster and state is smaller.

Anyway, it is possible to find cases where the state should be preserved, so I'll introduce another param called org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE by default false. If this is set as true, parent components containing  c:if, c:forEach, c:choose and ui:insert with src=ELExpression are marked to be restored fully.

It is still pending how to prevent addition / removal of h:outputScript / h:outputStylesheet. Right now, on every request, duplicate instances of h:outputScript / h:outputStylesheet are silently removed by UIViewRoot.addComponentResource(FacesContext, UIComponent, String). Maybe we should try use an interface for tag handlers called RelocatableComponent and update ComponentTagHandlerDelegate to "redirect" ComponentSupport.findChildByTagId and try to found instances on UIViewRoot facets "head" and "body", but resource instances are "inmutable", in other words, there is no use case where a resource instance changes its inner state after added to the tree.

> Find a way to allow c:if work with partial state saving enabled
> ---------------------------------------------------------------
>
>                 Key: MYFACES-2483
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2483
>             Project: MyFaces Core
>          Issue Type: Task
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.0-beta-2
>
>         Attachments: fixPSSIf2009JAN-10.patch, fixPSSIf2009JAN-11.patch, fixPSSIf2009JAN-14.patch, fixPSSIf2009JAN-7.patch
>
>
> This one is difficult to solve but I still think it is possible.
> It was explored trying to solve MYFACES-2428, and it seems ri is trying to do something about it too on:
> https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1408
> and
> https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1313
> One strategy to solve this one is this:
> 1. Mark the parent component containing c:if to not save it partially.
> 2. Do not execute c:if on postback and partial state saving enabled.
> In theory, the parent component should be restored fully from saved state.
> Note that things like:
> <c:if>....
>    <p>Some markup</p>
> <c:if>
> is just invalid. It is expected that c:if only contains components with state.

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