title: How to find out client ID of component for ajax update/render? Cannot find component with expression "foo" referenced from "bar"
body: <p>The following code is inspired from PrimeFaces DataGrid + DataTable Tutorials and put into a <code>&lt;p:tab&gt;</code> of a <code>&lt;p:tabView&gt;</code> residing in a <code>&lt;p:layoutUnit&gt;</code> of a <code>&lt;p:layout&gt;</code>. Here is the inner part of the code (starting from <code>p:tab</code> component); the outer part is trivial.</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;p:tabView id=&quot;tabs&quot;&gt;
      &lt;p:tab id=&quot;search&quot; title=&quot;Search&quot;&gt;                        
          &lt;h:form id=&quot;insTable&quot;&gt;
              &lt;p:dataTable id=&quot;table&quot; var=&quot;lndInstrument&quot; value=&quot;#{instrumentBean.instruments}&quot;&gt;
                  &lt;p:column&gt;
                      &lt;p:commandLink id=&quot;select&quot; update=&quot;insTable:display&quot; oncomplete=&quot;dlg.show()&quot;&gt;
                          &lt;f:setPropertyActionListener value=&quot;#{lndInstrument}&quot; 
                                          target=&quot;#{instrumentBean.selectedInstrument}&quot; /&gt;
                          &lt;h:outputText value=&quot;#{lndInstrument.name}&quot; /&gt;
                      &lt;/p:commandLink&gt;                                    
                  &lt;/p:column&gt;
              &lt;/p:dataTable&gt;
              &lt;p:dialog id=&quot;dlg&quot; modal=&quot;true&quot; widgetVar=&quot;dlg&quot;&gt;
                  &lt;h:panelGrid id=&quot;display&quot;&gt;
                      &lt;h:outputText value=&quot;Name:&quot; /&gt;
                      &lt;h:outputText value=&quot;#{instrumentBean.selectedInstrument.name}&quot; /&gt;
                  &lt;/h:panelGrid&gt;
              &lt;/p:dialog&gt;                            
          &lt;/h:form&gt;
      &lt;/p:tab&gt;
  &lt;/p:tabView&gt;
  </code></pre>
  <p>When I click the <code>&lt;p:commandLink&gt;</code>, the code stops working and gives the <a href="https://stackoverflow.com/search?q=%22Cannot%20find%20component%20with%20expression%22%20%22referenced%20from%22">message</a>:</p>
  <blockquote>
  <p>Cannot find component with expression &quot;insTable:display&quot; referenced from &quot;tabs:insTable:select&quot;.</p>
  </blockquote>
  <p>When I try the same using <code>&lt;f:ajax&gt;</code>, then it fails with a different <a href="https://stackoverflow.com/search?q=%22contains%20an%20unknown%20id%22%20%22cannot%20locate%20it%20in%20the%20context%20of%20the%20component%22">message</a> basically telling the same:</p>
  <blockquote>
  <p><code>&lt;f:ajax&gt;</code> contains an unknown id &quot;insTable:display&quot; cannot locate it in the context of the component &quot;tabs:insTable:select&quot;</p>
  </blockquote>
  <p>When it happens during another Ajax postback and the JSF project stage is set to <code>Development</code>, then it fails with a JavaScript alert with the <a href="https://stackoverflow.com/search?q=malformedXML%20%22during%20update%22%20%22not%20found%22">message</a>:</p>
  <blockquote>
  <p>malformedXML: During update: insTable:display not found</p>
  </blockquote>
  <p>How is this caused and how can I solve it?</p>