views:

226

answers:

0

I have a table where each cell click opens a tooltip using the componentControl tag, this works. But I wanted to pas a parameter to the tooltip, which is different per table cell.

<rich:toolTip id="tooltip" attached="false" mode="ajax">
 <ui:include id="projectDetailInclude" src="projectDetail.xhtml">
   <ui:param name="projectDetail" value="#{projectBean.getProjectDetail(project, index)}" />
 </ui:include>
</rich:toolTip>
<rich:dataTable id="detailDataTable" var="row" value="#{projectBean.projects}">
 <rich:column id="rowLabelColumn">
  <h:outputText value="#{row.label}" />
 </rich:column>
 <rich:columns id="detailColumns" var="column" value="#{projectBean.columns}" index="index" >
  <f:facet name="header">
   <h:outputText value="#{column}" />
  </f:facet>
  <div id="projectDetailBlock" class="#{row.values[index]}">
   <rich:componentControl event="onclick" for="tooltip" operation="show">
    <f:param name="project" value="#{project}" />
    <f:param name="index" value="#{index}" />
   </rich:componentControl>
  </div>
 </rich:columns>
</rich:dataTable>

In the code above, i try to pass the project and index parameters. All i get is a nice stacktrace. (which disappers when removing the params in the componentControl tag).

java.lang.StackOverflowError
 java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:54)
 sun.reflect.GeneratedMethodAccessor208.invoke(Unknown Source)
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 java.lang.reflect.Method.invoke(Method.java:597)
 org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)
 org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1132)
 org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)
 org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)
 org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
 org.ajax4jsf.javascript.ScriptUtils.writeScriptToStream(ScriptUtils.java:168)
 org.ajax4jsf.javascript.ScriptUtils.writeScriptToStream(ScriptUtils.java:174)
 org.ajax4jsf.javascript.ScriptUtils.writeScriptToStream(ScriptUtils.java:83)