Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-2262

UIXComponentBase calls setInView(false) before the component is actually removed from tree

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.0-core
    • 2.0.2-core, 2.1.0-core
    • Components
    • 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())

      { _publishPreRemoveFromViewEvent(context, child); }
      }

      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.

      Attachments

        Activity

          People

            gabrielle Gabrielle Crawford
            pudupa Prakash Udupa
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified