4 Replies Latest reply on Aug 17, 2007 2:38 PM by pucky

    rich:modalPanel problem inside datatable

    pucky

      I've been looking at this all night. I'm creating a dataTable with one column that contains a link that will show a modalPanel.

      My problem is that I can for the life of me figure out how to set the id of the modalPanel to something that is unique which will be used in the link.

      Any creative ideas?

      Pucky

        • 1. Re: rich:modalPanel problem inside datatable

           

          "pucky" wrote:

          My problem is that I can for the life of me figure out how to set the id of the modalPanel to something that is unique which will be used in the link.


          Sorry can you explain it a litlle better?

          • 2. Re: rich:modalPanel problem inside datatable
            pucky

            Sorry about that, sure,

            Below is an example of the modalPanel inside a dataTable. My problem is that I need the variable "mp" to be unique for each row in the dataTable.

            Any ideas?
            <h:dataTable value="#{mybean.records}" var="somethingcool">
            <h:column>
            <a href="javascript:Richfaces.showModalPanel('mp',{width:450, top:200})"><h:outputText value="#{somethingcool.title}"/>

            <rich:modalPanel id="mp" minHeight="200" minWidth="450" height="200" width="500" zindex="2000">

            <h:outputText value="#{somethingcool.data}"/>
            <a href="javascript:Richfaces.hideModalPanel('mp')">hide this panel

            </rich:modalPanel>
            </h:column>


            </h:dataTable>

            • 3. Re: rich:modalPanel problem inside datatable

              my comment:
              It is a bad idea in general to insert modalPanel in each row. Much, much better to have only one modalPanel and reRender its content based on the clicked row.

              • 4. Re: rich:modalPanel problem inside datatable
                pucky

                Well that makes it simple doesn't it. ;)

                Thanks vary much, that is the answer I'm looking for.