title: JSF Primefaces: how to update selectOneMenu(in form1) from dialogBox in form 2?
body: <p>I want to update a selectOneMenu in form1 after submitting the commandbutton in form2. It is now only visible after a refresh of the page.</p>
  
  <p>I have a selectOneMenu in form 1:</p>
  
  <pre><code>&lt;h:form id="form1" rendered="#"&gt;
  
              &lt;p:spacer height="30" /&gt;
              &lt;h:selectOneMenu id="oneMenu" value="#{bean.value}"&gt;
                  &lt;f:selectItem itemLabel="Select Value" itemValue="" /&gt;
                  &lt;f:selectItems id="itemValues"
                      value="#{bean.allItems}" var="allItems"
                      itemValue="#{allItems}" itemLabel="#{allItems.name}" /&gt;
              &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p></p>
  
  <p>and a DialogBOX in form2:</p>
  
  <pre><code>&lt;h:form id="form2"&gt;
              &lt;p:dialog header="Create new Item" widgetVar="newItem"
                  resizable="false"&gt;
  
                  &lt;h:panelGrid columns="2" style="margin-bottom:10px"&gt;
  
                      &lt;h:outputLabel for="item" value="Itemname:" /&gt;
                      &lt;p:inputText id="itemname" value="#{bean.itemName}" /&gt;
                  &lt;/h:panelGrid&gt;
  
                  &lt;p:commandButton value="Submit"
                      actionListener="#{bean.newItem}"
                      update="form1:oneMenu" oncomplete="newItem.hide();"  /&gt;
  
              &lt;/p:dialog&gt;
  </code></pre>
  
  <p></p>
  
  <p>I've tried <code>update="form1:oneMenu"</code> but it doesn't work. I've also read <a href="https://stackoverflow.com/questions/5250370/jsf-and-primefaces-update-problem">this post</a> 
  but it doesn't work either.</p>
  
  <p>Thanks for help.</p>