1 Reply Latest reply on Jul 14, 2009 12:05 PM by niox.nikospara.yahoo.com

    what link component to use to display modalPanel from dataTable in form?

    asookazian

      I need to display a rich:modalPanel from a foo link in a dataTable column.  I don't want to submit the form.  What is the correct way to do this in JSF/Seam/RF?


      I was thinking I just need to call Richfaces.showModalPanel('fooModalPanel');  No form submission, no action method, very simple.


      Can I use <s:link> to do this? If yes, how?

        • 1. Re: what link component to use to display modalPanel from dataTable in form?
          niox.nikospara.yahoo.com

          The way I have done this is with a simple HTML anchor element:


          <rich:dataTable ...>
          ...
          <h:column>
          <a href="#"
            onclick="
              delItem('#{item.name}',#{item.id});
              #{rich:component('deleteDialog')}.show();
              return false
            ">
          </h:column>
          ...
          </rich:dataTable>
          



          (The delItem() JS function is irrelevant; it is used to customize the modalPanel, without roundtrips to the server.)


          The modalPanel itself is declared as follows, in the same NamingContainer as the previous script:


          <rich:modalPanel id="deleteConfDialog">
          ...
          </rich:modalPanel>
          



          I believe using Richfaces.showModalPanel('fooModalPanel') in the <a onclick="..."> would have the same effect, as long as fooModalPanel is the client id of the modalPanel.