6 Replies Latest reply on Jan 16, 2008 12:39 PM by sansaric

    Context menu in rich:datatable


      I currently use an h:datatable tag to render a table with several columns. One of the columns is a commandLink tag which when clicked is handled by a bean method which captures the DataModel row object that was clicked and does some further processing before displaying a detail page on the row clicked.

      I would like to use the rich:datatable tag instead of h:datatable in conjuction with rich:contextMenu to display a menu of 2 or 3 options when a table row is clicked and when one of the menu options is selected, a bean method is invoked and access to the table row object is available based on the row clicked using DataModel.getRowData(). Is this possible and if so, what is the best way of doing so ?

      Excerpt of current jsf page:
      <h:panelGrid columns="1" align="left">
      <h:dataTable id="myDataTable" value="{myHandler.myDataModel}" var="job" width="100%">
      <f:facet name="header">
      <h:outputText escape="false" value="Job #" >
      <h:commandLink value="#{job.jobID}" action="#{myHandler.handleMyCurrentJob}" >


      bean method excerpt:
      public String handleMyCurrentJob() throws Exception {
      myCurrentJob = (JobBean) myJobsDataModel.getRowData();

      do more processing

      Thanks in advance for your help,