Assign a unique client ID to each <rich:dataTable /> row?

Posted by Dolph Mathews on Stack Overflow See other posts from Stack Overflow or by Dolph Mathews
Published on 2010-05-19T15:07:34Z Indexed on 2010/05/19 15:10 UTC
Read the original article Hit count: 330

Filed under:
|
|

I'm relatively new to working with the UI in Seam, so I'm hoping there is something simple I can replace the three instances of UNIQUE_ID with in the following example (such as #{object.uniqueId}).

The goal is to have a <rich:dataTable /> wherein each row has the ability to show/hide a <rich:modalPanel /> with more details about the particular object instance.

<rich:dataTable var="object" value="#{bean.myObject}">
  <rich:column>
    <h:outputText value="#{object.summary}" />
  </rich:column>

  <rich:column>
    <a onclick="Richfaces.showModalPanel('UNIQUE_ID');" href="#">Show Details in ModalPanel</a>
    <a4j:form>
      <rich:modalPanel id="UNIQUE_ID" >
        <a onclick="Richfaces.hideModalPanel('UNIQUE_ID');" href="#">Hide This ModalPanel</a>
        <h:outputText value="#{object.details}" />
      </rich:modalPanel>
    </a4j:form>
  </rich:column>
</rich:dataTable>

If I only had one link/modalPanel pair, this would obviously be trivial, but I don't know what to do within the scope of the <rich:dataTable />'s iteration. Also, in case it complicates things further, the page will also contain many <rich:dataTable />'s, each implementing this behavior.

© Stack Overflow or respective owner

Related posts about seam

Related posts about jsf