0 Replies Latest reply on Jul 29, 2008 10:46 AM by aogier.netangel+seamframework.gmail.com

    rich:tooltip inside a rich:dataTable : How to pass arguments ?

    aogier.netangel+seamframework.gmail.com

      Hi all,


      I've got a dataTable iterating over products, and I want the user to click on an eye button which would render a toolTip to retrieve more information about that product. Here is the code :



        <rich:dataTable var="product" value="#{productService.findForParam(param)}" rows="10">
          <rich:column>
            <f:facet name="header">#{messages.bean_label}</f:facet>
            <h:outputText value="#{product.label}" />
          </rich:column>
            
          <rich:column>
            <rich:panel>
              <h:graphicImage url="/img/eye.gif"/>
              <rich:toolTip mode="ajax" showEvent="onclick">
                <f:facet name="defaultContent">
                  <h:graphicImage value="/img/progress.gif"/>
                </f:facet>
                <span>
                  <h:outputText value="#{product.label} - #{product.price}"/>
                </span>
              </rich:toolTip>
            </rich:panel>
          </rich:column>
      
        </rich:dataTable>
      



      The problem is that when clicking on the eye image, calling the AJAX render of the toolTip, that always contains the first product of my dataTable, and not the one I've clicked.


      I've seen on Exalead demo of ToolTip that there is a special treatment for dataTables, but that code is realy unclear (I don't understand what's the point of setting the current row to a backing bean with an a4j:actionparam, because the variable used in the panel is the dataTable one ...)


      Can someone give me a hint for my issue ?