title: How to rerender part of page with form in JSF 2.0?
body: <p>Currently we're trying to move to JSF 2.0 from JSF 1.2 and one of the problem we've faced is that it's impossible to rerender part of the page that contains form. Like this (rerender <code>outerDiv</code> or forms themselves):</p>
  
  <pre><code>&lt;h:panelGroup id="outerDiv"&gt;
      &lt;h:form id="form1"&gt;...&lt;/h:form&gt;
      &lt;h:form id="form2"&gt;...&lt;/h:form&gt;
  &lt;/h:panelGroup&gt;
  </code></pre>
  
  <p>I mean that if i update <code>outerDiv</code> everything is updated but the form (or forms) itself becomes broken and behaves strangely, at least ajax calls either don't work when first time triggered or instead of calling some bean's method they create new instance of that bean and do nothing (either with destroying previous with every call or just creating new one on first call and then do nothing). The problem can be solved  by rerendering only components inside form, like this (update <code>innerDiv1</code> and <code>innerDiv2</code>):</p>
  
  <pre><code>&lt;h:panelGroup id="outerDiv"&gt;
     &lt;h:form id="form1"&gt;
         &lt;h:panelGroup id="innerDiv1"&gt;...&lt;/h:panelGroup&gt;
     &lt;/h:form&gt;
     &lt;h:form id="form2"&gt;
         &lt;h:panelGroup id="innerDiv2"&gt;...&lt;/h:panelGroup&gt;
     &lt;/h:form&gt;
  &lt;/h:panelGroup&gt;
  </code></pre>
  
  <p>but we have a lot of places where we include some page with <code>ui:include</code> and it's not very convenient to look inside that page and update certain components there. Besides we'll have to modify all these pages as many of them don't have common wrapper div inside forms and update each component separately will be very cumbersome and error prone.<br>
  So, is it possible to make JSF 2.0 correctly update part of page with 1-st approach like it was in JSF 1.2?</p>
  
  <hr>
  
  <p>EDIT: it looks like the issue with form rendering is richfaces 4.2 issue as i use <code>a4j:ajax</code> (successor of <code>a4j:support</code> that was used with richfaces 3.3.3) and custom buttons based on <code>rich:commandButton</code>. When i substituted them with native jsf's <code>f:ajax</code> forms seems to be refreshed correctly. But issue with outer div is still actual </p>