title: Get client ID of composite component itself for usage in JavaScript
body: <p>I have got some interesting issue for you. I am creating a composite component. I know, that I can use ui:param for storing value and reuse it. But what if I store to this variable some relative value (#{component.namingContainer.clientId}) and want to reuse it as a constant? It is difficult to explain - here you have my code:</p>
  
  <pre><code>&lt;ui:param name="rdfaComp" value="#{component.namingContainer.clientId}"/&gt;
  </code></pre>
  
  <p>This is in the beginning of the page - I want to store exactly this ID and then use nothing else by this variable. But later if I reuse it inside elements with own IDs, it is bad. It is interesting, what happens - JSF doesn't take the same value, but a relative one. It reads once more #{component.namingContainer.clientId}, not the fixed value.</p>
  
  <p>How to solve this, could you help me, please? THanks a lot.</p>
  
  <p><strong>UPDATED</strong>
  There is still one important condition: the variable rdfaComp have to be available immediately, because I reuse it in a Javascript function (on the same page). Like this:</p>
  
  <pre><code>&lt;h:commandButton onclick="return selectText('#{rdfaComp}:editor', ...
  </code></pre>
  
  <p>I am afraid, it is necessarry to use relative ID chains like this: #{component.namingContainer.parent.namingContainer.parent.clientId} etd.
  But it is really awful. Is there another solution? </p>