Leonardo Uribe created MYFACES-3630:
---------------------------------------

             Summary: PartialViewContextImpl.findHeadComponent and 
findBodyComponent does not take into account h:head or h:body inside child of 
UIViewRoot
                 Key: MYFACES-3630
                 URL: https://issues.apache.org/jira/browse/MYFACES-3630
             Project: MyFaces Core
          Issue Type: Bug
            Reporter: Leonardo Uribe
            Priority: Minor


There is a small bug on PartialViewContextImpl.findHeadComponent. It says this:

    private UIComponent findHeadComponent(UIViewRoot root)
    {
        for (UIComponent child : root.getChildren())
        {
            if (child instanceof HtmlHead)
            {
                return child;
            }
            else
            {
                for (UIComponent grandchild : child.getChildren())
                {
                    if (child instanceof HtmlHead)
                    {
                        return child;
                    }
                }
            }
        }
        return null;
    }

but it should be this:

    private UIComponent findHeadComponent(UIViewRoot root)
    {
        for (UIComponent child : root.getChildren())
        {
            if (child instanceof HtmlHead)
            {
                return child;
            }
            else
            {
                for (UIComponent grandchild : child.getChildren())
                {
                    if (grandchild instanceof HtmlHead)
                    {
                        return grandchild;
                    }
                }
            }
        }
        return null;
    }

Usually h:head and h:body are direct children of UIViewRoot, so it is difficult 
to see any problem. This is only relevant when 
org.apache.myfaces.STRICT_JSF_2_REFRESH_TARGET_AJAX web config param is set to 
true.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to