title: "empty" IllegalArgumentException with nested JSF h:panelGroups and f:ajax
body: <p>I'm having problems updating an inner nested <code>h:panelGroup</code> element using <code>f:ajax</code>. I have minimized my problem into following example:</p>
  
  <pre><code>&lt;h:form id="someForm"&gt;
      &lt;h:panelGroup id="wrapper"&gt;
          &lt;h:panelGroup id="content"&gt;
              Some Content
          &lt;/h:panelGroup&gt;
      &lt;/h:panelGroup&gt;
  
      &lt;h:commandLink
          action="#{bean.changeContent()}"
          value="Do Something"&gt;
          &lt;f:ajax render=":someForm:wrapper:content"/&gt;
      &lt;/h:commandLink&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>When i try to open the page, the <code>findComponent</code> method throws an <code>IllegalArgumentException</code> with no further information:</p>
  
  <pre><code>Severe:   Error Rendering View[/view/group/invitation/testCase.xhtml] 
     java.lang.IllegalArgumentException: wrapper
  at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:655)
  at com.sun.faces.renderkit.html_basic.AjaxBehaviorRenderer.getResolvedId(AjaxBehaviorRenderer.java:302)
  at com.sun.faces.renderkit.html_basic.AjaxBehaviorRenderer.appendIds(AjaxBehaviorRenderer.java:292)
  at com.sun.faces.renderkit.html_basic.AjaxBehaviorRenderer.buildAjaxCommand(AjaxBehaviorRenderer.java:225)
  at com.sun.faces.renderkit.html_basic.AjaxBehaviorRenderer.getScript(AjaxBehaviorRenderer.java:89)
  ...
  </code></pre>
  
  <p>I looked into the implementation and found following section that was causing the Exception:</p>
  
  <pre><code>...
  result = findComponent(base, segments[i], (i == 0));
  // the first element of the expression may match base.id
  // (vs. a child if of base)
  if (i == 0 &amp;&amp; result == null &amp;&amp; segments[i].equals(base.getId())) {
      result = base;
  }
  if (result != null &amp;&amp; (!(result instanceof NamingContainer)) &amp;&amp; length &gt; 0) {
      throw new IllegalArgumentException(segments[i]);
  }
  ...
  </code></pre>
  
  <p>I debugged the program, the component is found (by the first line of the code above), so my only conclusion is that <code>h:panelGroup</code> is not an instance of <code>NamingContainer</code>, but after reading <a href="https://stackoverflow.com/questions/8634156/cannot-find-component-with-expression-foo-referenced-from-bar-fajax-con/8644762#8644762">this post</a> and checking the generated HTML for other examples my understanding was that a <code>h:panelGroup</code> IS a naming container. However, when i remove the wrapper and tell the ajax element to update the <code>content</code> <code>panelGroup</code> directly, no exception is thrown. I probably don't fully understand the method that JSF uses to search through the elements, I'd appreciate it if someone could explain to me why this tiny example behaves this way.
  I am using Mojarra 2.2.0 on GlassFish 4.0</p>