title: Dynamic Id's in JSF/Seam
body: <p>Got a little problem with a Seam application I'm working on and I was wondering if anyone knows a way round it.  I've got a form in my application that uses AJAX to show certain input boxes depending on an item in a dropdown box.  The code works fine except for setting the ID's in my input boxes.  It looks like JSF doesn't let me set an ID via a variable.  Other attributes like "for" in labels are fine.  Here's some code explaining what I mean:</p>
  
  <pre><code>&lt;ui:repeat value="#{serviceHome.instance.serviceSettings}" var="currSetting" &gt;
    &lt;li&gt;
      &lt;!-- Imagine the below works out as "settingABC" --&gt;
      &lt;c:set var="labelKey" value="setting#{jsfUtils.removeWhitespace(currSetting.key.name)}" /&gt;
  
      &lt;!-- Labelkey is correctly added into this input so for = "settingABC" --&gt;
      &lt;h:outputLabel for="#{labelKey}" styleClass="required generated" value="#{currSetting.key.name}:"/&gt;
  
      &lt;s:decorate styleClass="errorwrapper"&gt;
  
        &lt;!-- Labelkey ISN'T correctly added into this input. Instead we just get "setting" --&gt;
        &lt;h:inputText id="#{labelKey}" value="#{currSetting.value}"/&gt;
  
        &lt;a4j:outputPanel ajaxRendered="true"&gt;
          &lt;h:message for="#{labelKey}" styleClass="errormessage" /&gt;
        &lt;/a4j:outputPanel&gt;
      &lt;/s:decorate&gt;
    &lt;/li&gt;
  &lt;/ui:repeat&gt;
  </code></pre>
  
  <p>Does anyone have any idea how I can get past this?</p>