title: JSF ajax commandbutton from multiple forms within same page reinitiliazes the viewscoped bean
body: <p>changeThe page has 2 forms. In the first form, the ajax-button initializes an attribute of the viewscoped managed bean. In the second form, the ajax-button uses that attribute to do some stuff. <br />Problem is that the method called by the second form button never gets invoked. Instead, the viewscoped bean is re-initialized and when I hit the same button again, of course the attribute is null resulting in NPE.<br />When I put the 2 buttons within the same form, then everything works as expected.<br />Is this normal: should ajax enabled buttons always reside within the same form?</p>
  
  <pre><code>&lt;h:form id="frmDetail"&gt;    
      &lt;h:commandButton  id="btn_changePlant" title="#{msg.ttChangePlant}" immediate="true"  image="/resources/img/edit.png"&gt;
          &lt;f:ajax event="click" render=":fsDetailPlant :headerMsg"  listener="{assortiment.detailPlantId}"/&gt;
      &lt;/h:commandButton&gt;
  &lt;/h:form&gt;
  ...some other code ...
  &lt;h:form id="frmOffers"&gt;    
      &lt;h:commandButton  id="btn_offers" title="#{msg.ttOfferPlant}" immediate="true"  value="#{msg.btn_offers}"&gt;
          &lt;f:ajax event="click" render=":fsDetailPlant :headerMsg"  listener="{assortiment.changeOffers}"/&gt;
      &lt;/h:commandButton&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>and the managed bean looks like</p>
  
  <pre><code>@ManagedBean
  @ViewScoped
  public class Assortiment extends BeanObject implements Serializable {
      ....
  
  public void detailPlantId(AjaxBehaviorEvent actionEvent) {
      clear();
      plantdetail = facade.findPlantdetail(plantdetailsIdModel.getRowData());
  }
  
    public void changeOffers(AjaxBehaviorEvent actionEvent) {
      System.out.println("........ Assortiment.changeOffers(AjaxBehaviorEvent actionEvent)");
      if (containerItems.isEmpty()) {
          SessieUtils.fillPropertyItems(containerItems, PlantProperty.codeValuesList(ECodeType.logistic, "L02"), facade.getLocale());
      }
      //
      if (offersModel == null) {
          offersModel = new ListDataModel&lt;OffersDto&gt;(plantdetail.getOffersList());
      }
  }
  </code></pre>