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/01/14 02:46:54 UTC

[jira] Reopened: (MYFACES-2389) clean up the UIComponentBase.setParent()

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

Leonardo Uribe reopened MYFACES-2389:
-------------------------------------


The new algorithm cause some problems with a previous hack to allow component relocation.

After checking the latest javadoc, the method UIComponent.getChildren still says the following:

".....After the child component has been added to the view, if the following condition is not met:

      FacesContext.isPostback() returns true and FacesContext.getCurrentPhaseId() returns PhaseId.RESTORE_VIEW

Application.publishEvent(javax.faces.context.FacesContext, java.lang.Class, java.lang.Object) must be called, passing PostAddToViewEvent.class as the first argument and the newly added component as the second argument....."

But the documentation of the spec section 2.2.1 Restore View says this:

"....If the request is a postback, call setProcessingEvents(false) on the current FacesContext. Then call ViewHandler.restoreView()...."

In this case, the javadoc is wrong and the spec pdf is right. Use FacesContext.setProcessingEvents is more clean and allow create components that can be moved on the component tree using a listener on PostAddToViewEvent. Our previous hack (PostBuildComponentTreeOnRestoreViewEvent) is no longer necessary, but note when we call buildView on restoreView and partial state saving enabled, the events are enabled again to keep the tree like on first request.



> clean up the UIComponentBase.setParent()
> ----------------------------------------
>
>                 Key: MYFACES-2389
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2389
>             Project: MyFaces Core
>          Issue Type: Improvement
>    Affects Versions: 2.0.0-alpha
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>             Fix For: 2.0.0-alpha
>
>         Attachments: MYFACES-2389.patch
>
>
> current version needs some clean ups. Also it is NOT clear if the current behavior is really 100% compliant to the SPEC, as it doesn't say much. Same is true for the JavaDocs.
> Filed this SPEC/JSF API bug:
> https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1384

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