0 Replies Latest reply on May 31, 2011 3:58 AM by mtle

    selectedRow is always last row, if working with modalPanel

    mtle

      Hi,

       

      I have the followin sceanrio with richfaces 3.3.3 final and Spring Webflow 2.2.0:

       

      There is a commandLink in each row of a rich:dataTable.

       

      <a4j:commandLink onclick="#{rich:component('confirmation')}.show();return true">
           <h:graphicImage value="/images/delete.png" />
      </a4j:commandLink>
      <a4j:jsFunction name="submit" action="deleteAdress" />
      

       

      This invokes a modal panel, that asks something like: 'Are you sure you want to delete this Adress'?

       

      This modalpanel looks like this:

       

      <rich:modalPanel id="confirmation" width="250" height="100">
          <f:facet name="header" />
          <h:panelGrid>
              <h:panelGrid columns="2">
                  <h:graphicImage value="/images/alert.png" title="Icon from Asher (http://kyo-tux.deviantart.com/)"/>
                  <h:outputText value="#{msg.sure}" styleClass="confirmation" />
              </h:panelGrid>
              <h:panelGroup>
                  <input type="button" value="OK" onclick="#{rich:component('confirmation')}.hide();submit();return false" style="float:left" />
                  <input type="button" value="#{msg.cancel}" onclick="#{rich:component('confirmation')}.hide();return false" style="float:right" />
              </h:panelGroup>
          </h:panelGrid>
      </rich:modalPanel>
      

       

      The action "deleteAdress" invokes a transition in Spring Webflow which calls a method with the selectedRow of the adress list as a parameter.

       

      The problem ist, that the selectedRow is always the last row of the dataTable, no matter which row I clicked on.

       

      If I do it this way:

       

      <h:commandLink action="deleteAdress">
           <h:graphicImage value="/images/delete.png" />
      </h:commandLink>
      

       

      the selectedRow is correct.

       

      I debugged a little bit and saw that the facesEvent already contains the wrong row.

      Does anyone hava an idea what the problem could be here?

       

      Thanks in advance!

       

      mt le