Need help with rich:componentControl in with rich:dataTable
sansaric Feb 22, 2008 10:01 AMI am using a usecase similar to the one described in the rich:componentControl demo and reused most of the demo code, however I am experiencing problems with the context menu. It pops up when I click on a dataTable row as expected and the value is transfered in the a4j:outputPanel specified in the code below if I click on the menu item. The problem is that after the menu is displayed and I point the mouse inside it, the menu item is not highlighted in orange as in the demo and after I clickon the menu item or move the mouse away from the menu area, the popup menu never disappears.
Any suggestions on how to resolve this problem ?
Thanks in advance for your help.
Below is the subview code:
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%><%@taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
<%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<f:subview id="MySubview">
.cur{
cursor:pointer;
}
<rich:contextMenu attached="false" id="MyMenu" submitMode="ajax">
<rich:menuItem ajaxSingle="true">
<h:outputText escape="false"
value="Select job # {jobId} for upload"/>
<a4j:actionparam name="jobId"
assignTo="#{myJobsHandler.myCurrentJobId}"
value="{jobId}"/>
</rich:menuItem>
</rich:contextMenu>
<h:panelGrid columns="1">
<rich:spacer height="5" />
<rich:datascroller align="center" for="myJobsDataTable" maxPages="20" />
<rich:spacer height="5" />
<rich:dataTable id="myJobsDataTable"
value="#{myobsHandler.myJobsDataModel}"
var="job"
rows="10"
width="100%"
onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
rowClasses="cur">
<rich:column width="50px">
<f:facet name="header">
<h:outputText escape="false" value="Job #" styleClass="informationalMsg"/>
</f:facet>
<h:outputText value="#{job.jobId}" styleClass="informationalMsg"/>
</rich:column>
<rich:componentControl event="onRowClick" for="MyMenu" operation="show">
<f:param value="#{job.jobId}" name="jobId"/>
</rich:componentControl>
</rich:dataTable>
<a4j:outputPanel ajaxRendered="true">
<rich:panel>
<f:facet name="header">
<h:outputText value="Job # for File Upload" styleClass="informationalMsg"/>
</f:facet>
<h:outputText value="#{myJobsHandler.myCurrentJobId}"></h:outputText>
</rich:panel>
</a4j:outputPanel>
</h:panelGrid>
</f:subview>