4 Replies Latest reply on Mar 30, 2007 5:16 AM by alexanderbelov

    Can anyoine help ? Multiple modal panels

    sammes

      Hi,

      I am using richfaces 3.0.1 and I have a dataTable with many entries.

      For each row I have a delete button which deletes the specific entry.

      Now I want to use the modalPanel for a "delete confirmation".

      So, I need multiple modal panels (one for each row).

      I added an identifier to the js call (link), but I am not sure how to tell each modal panel the specific id.

      The code looks like this:

      <h:form id="ruleGroupForm">
      
      <rich:dataTable
       onRowMouseOver="this.style.backgroundColor='#F5F5F5'"
       onRowMouseOut="this.style.backgroundColor='#FFFFFF'"
      ...>
      
      <f:facet name="header">
       <rich:columnGroup>
       <rich:column>
       <h:outputText value="Id" />
       </rich:column>
       <rich:column>
       <h:outputText value="Group Name" />
       </rich:column>
       <rich:column style="width:150px">
       <h:outputText value="Action" />
       </rich:column>
       </rich:columnGroup>
      </f:facet>
      
      <rich:columnGroup>
       <rich:column>#{ruleGroup.regId}</rich:column>
      
       <rich:column>#{ruleGroup.regName}</rich:column>
      
       <a href="javascript:Richfaces.showModalPanel('ruleGroupForm:mp#{ruleGroup.regId}',{width:450, top:200})">delete</a>
      
      <rich:modalPanel id="mp" minHeight="200" minWidth="450"
       height="200" width="500" zindex="2000">
       <f:facet name="header">
       <h:outputText value="Delete Rule Group Confirmation" />
       </f:facet>
       <f:facet name="controls">
       x
       </f:facet>
       <a4j:commandButton styleClass="button_blue_border_blue" value="Delete Group" action="#{ruleGroupMaintenance.deleteGroup}" reRender="rules">
       <t:updateActionListener property="#{ruleGroupMaintenance.groupId}" value="#{ruleGroup.regId}"/>
       </a4j:commandButton>
       &#160;
       <a href="javascript:Richfaces.hideModalPanel('ruleGroupForm:mp#{ruleGroup.regId}')">close</a>
      </rich:modalPanel>
      
       </rich:column>
      </rich:columnGroup>
      
      </rich:dataTable>
      
      </h:form>
      


      I tried to do something like this:

      <rich:modalPanel id="mp#{ruleGroup.regId}" minHeight="200" ...


      to tell the panel the same id I pass in the js call in the link.

      But this does not work.

      Could anyone help ?
      regards