0 Replies Latest reply on Mar 24, 2008 5:07 PM by Paul Pantages

    componentControl and oncontextmenu with rich:dataTable

    Paul Pantages Novice

      Richfaces 3.1.4.GA,JBOS 4.2.2,Seam 2.0.1.GA

      Is there a way to emulate an "onContextMenu" event for a row in rich:dataTable?
      I want to use onRowClick for something else, and I don't know how to tell if a mouseDown
      event was from the left or right button...

      I would like this to work in the same way as it does for treeNode,
      i.e., I would like to have an "onRowContextMenu" which is
      distinguished (exclusive) from "onRowClick".

      I saw the topic:
      which advises one to put the component control inside the columns.

      However, putting componentControl inside the rich:column does not make
      the event "oncontextmenu" work. The menu does not appear. To test, I
      tried with the "onmousedown" event, which is OK, so I am assuming that the contextMenu event is not supported.

      Here is my componentControl:

       rowClasses="alarmRowOdd, alarmRowEven"
       onRowClick="fselect('#{networkElement.id}', ctrlkey )"
       rendered="true" >
       <c:forEach items="#{nodeRowFormats.columnDataModel}" var="column">
       <rich:column sortable="false"
       styleClass="#{(nodeTable.nodeSelections[networkElement.id]) ? 'selectedrow'
       : ( (column=='connectionState') ? networkElement.styleClass : 'unselectedrow' ) }" >
       <f:facet name="header">
       onclick="fsort('#{column}')" />
       <h:outputText value="#{networkElement[column]}"/>
       <rich:componentControl event="onRowMouseDown" for="menu" operation="show">
       <f:param value="#{networkElement.id}" name="neId"/>
       <f:param value="#{networkElement.name}" name="name"/>

      For the richfaces team, could you consider adding support for
      "onRowContextmenu" in a future release?