title: Value to update attribute of primefaces command button
body: <p>I have a query here regarding the value given to the update attribute of the primefaces command button.</p>
  
  <p>Here is a simple code. I have a simple xhtml page</p>
  
  <pre><code>&lt;h:body&gt;
  &lt;h:form id="main"&gt;
      &lt;p:growl id="maingrowl" showDetail="true"&gt;&lt;/p:growl&gt;
      &lt;p:panelGrid id="mainpanel" columns="2"&gt;
  
              &lt;p:commandButton value="Ajax Submit" update="test" id="ajax"
                  actionListener="#{mytestBean.display}" /&gt;
  
  
      &lt;/p:panelGrid&gt;
  
      &lt;p:panelGrid id="test" rendered="#{mytestBean.show}" columns="1"&gt;
          &lt;h:inputText value="#{mytestBean.val1}" /&gt;
          &lt;h:inputText value="#{mytestBean.val2}" /&gt;
          &lt;p:commandButton value="value in" id="aj" update="test"
              actionListener="#{mytestBean.displaysec}"&gt;
              &lt;/p:commandButton&gt;
      &lt;/p:panelGrid&gt;
  
  &lt;/h:form&gt;
  &lt;/h:body&gt;
  </code></pre>
  
  <p>Now, If I have to update the panelgrid "test" then in the first command button I have to provide the id "test" prefixed with ":main:" in the update attribute of the command button since that is the exact id in the HTML DOM as I find it in the <em>view source</em> in the browser. But, I was able to update even by given just "test" in the update attribute.
  So my question here is when should I use the ":" in the id or is it mandatory or is there any pre defined rule to give the id's in the attribute?</p>
  
  <p>Also, I am aware of the fact that the id given in the update attribute is through the UINamingContainer in which it is placed. Please pardon me if its trivial, I am really confused here.</p>
  
  <p>Any help greatly appreciated.
  Thank you.</p>