6 Replies Latest reply on Sep 19, 2007 12:06 PM by mwkohout

    Different modalPanel from each cell of a dataGrid?

      Hi
      I'm trying to figure out if it's possible to have a dataGrid such that a different modalPanel can be associated with each cell in the grid. The aim of this is to report summary data in the grid and when it's clicked on the full data is shown in the modalPanel. My code that doesn't work looks like this:

      <rich:dataGrid value="#{clientManager.diaryDays}" var="diaryDay" columns="7">
       <rich:panel onclick="Richfaces.showModalPanel('details#{diaryDay.dayOfMonth}')">
       <f:facet name="header">#{diaryDay.dayOfMonth}</f:facet>
       <f:subview rendered="#{diaryDay.events.size() > 0}">
       <h:outputText value="Events: #{diaryDay.events.size()}"/>
       <br/>
       <h:outputText value="Staff: #{diaryDay.staffQuantity}"/>
       </f:subview>
       <rich:modalPanel id="details#{diaryDay.dayOfMonth}">
       <f:facet name="header">#{diaryDay.dayOfMonth}</f:facet>
       <h:commandButton value="Cancel" onclick="Richfaces.hideModalPanel('details#{diaryDay.dayOfMonth}')"/>
       </rich:modalPanel>
       </rich:panel>
      </rich:dataGrid>
      


      The line that appears to break things is:

      <rich:modalPanel id="details#{diaryDay.dayOfMonth}">


      Is there some way to dynamically generate the id? If not does anyone have any suggestions on the best way to tackle this problem (or any other comments on what I've done - I'm pretty new at this!)?

      Thanks!