title: PrimeFaces SelectOneMenu ajax rendering
body: <p>What was wrong in my program? I think everything is fine. My <code>changeKeyValue</code> method get the selected value 'REFERENCE' and set <code>true</code> boolean value into <code>showReference</code>.
  But, my page cannot render <code>h:panelGroup</code> if I use <code>update="targetPanel"</code> in <code>p:ajax</code>.
  It can render <code>h:panelGroup</code> when I use <code>update="entryForm"</code>.</p>
  
  <p><strong>What I am missing?</strong></p>
  
  <p>mypage.xhtml</p>
  
  <pre><code>&lt;h:form id="entryForm"&gt;
          &lt;p:selectOneMenu value="#{MyBean.keyFactorValue}" required="true" style="width:257px;" id="keyFactorValue"&gt;
              &lt;f:selectItems value="#{MyBean.selectItemList}" var="type" itemLabel="#{type.label}" itemValue="#{type}"/&gt;  
              &lt;p:ajax listener="#{MyBean.changeKeyValue}" update="targetPanel" event="change"/&gt;
          &lt;/p:selectOneMenu&gt;
  
          &lt;h:panelGroup id="targetPanel" rendered="#{MyBean.showReference}"&gt;
              .......
          &lt;/h:panelGroup&gt;
  
  &lt;/h:form&gt;
  </code></pre>
  
  <p>KeyFactorValue.java</p>
  
  <pre><code>public enum KeyFactorValue {
      REFERENCE("Reference"), FORM_TO("From-To"), FIXED("Fixed");
  
      private String label;
  
      private KeyFactorValue(String label) {
          this.label = label;
      }
  
      public String getLabel() {
          return label;
      }
  }
  </code></pre>
  
  <p>MyBean.java</p>
  
  <pre><code>@Scope(ScopeType.CONVERSATION)
  @Name("MyBean")
  public class MyBean {
      private boolean showReference;
  
      public boolean isShowReference() {
          return showReference;
      }
  
      public KeyFactorValue[] getSelectItemList() {
          return KeyFactorValue.values();
      }
  
      public void changeKeyValue(AjaxBehaviorEvent e) {
          KeyFactorValue type = keyFactor.getKeyFactorValue();
          System.out.println("Selected KeyFactorValue : " + type);
          switch(type) {
              case REFERENCE :{
                  showReference = true;
                  break;
              }
              default :{
                  showReference = false;
                  break;
              }
          }
      }
  
  }
  </code></pre>