Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.0-core
-
None
Description
We currently have this code in Trinidad's org.apache.myfaces.trinidad.component.UIXComponentBase
/**
- Publish PreRemoveFromViewEvent to the component and all facets and children.
* - @param context the current FacesContext
- @param component the current UIComponent
*/
private void _publishPreRemoveFromViewEvent(
FacesContext context,
UIComponent component)
{
component.setInView(false);
context.getApplication().publishEvent(context,
PreRemoveFromViewEvent.class, UIComponent.class, component);
if (component.getChildCount() > 0)
{
for (UIComponent child : component.getChildren())
}
if (component.getFacetCount() > 0)
{
for (UIComponent child : component.getFacets().values())
{ _publishPreRemoveFromViewEvent(context, child); }
}
}
setInView(false) is called even before the component is actually removed from the tree. This would cause issues elsewhere (say the PreRemoveFromViewEvent listeners) that finds that the component is no more registered as being in the view whereas the component is not removed yet.
Mojarra guys are also finding this bogus code in Trinidad to block their fixes (eg. http://java.net/jira/browse/JAVASERVERFACES-2390). Some partial state saving usecases in Oracle's ADF is also not working as expected because of this defect. This needs to be fixed, the fix could be as simple as moving setInView(false) to be called later to actual removal.