1 Reply Latest reply on Sep 14, 2009 2:59 PM by Adi Sharma

    onRowClick event on rich:extendedDataTable

    Adi Sharma Newbie

      I had been using the onRowClick event with the rich:scrollableDataTable to call a takeSelection() method, this stopped working once I switched to the rich:extendedDataTable, I get a java.util.NoSuchElementException on the bold line:

      public Object takeSelection() {
      Iterator i = getSelection().getKeys();
      Object key = i.next();
      table.setRowKey(key);
      if (table.isRowAvailable()) {
      return table.getRowData();
      }
      return null;
      }

      essentially meaning that the iterator doesn't have anything. This used to work fine with the scrollableDataTable.
      Now I can use the onselectionchange event instead, which does work. But onselectionchange isn't the same as onrowclick. Clicking on an already selected row doesn't do anything, I want a modal panel to appear on clicking a row.

      Is there a way through the RichFaces javascript API that I can trigger onselectionchange on onRowClick? So that I can have two a4j:support tags, one that triggers onselectionchange on onRowClick and another that calls the takeSelection() on onselectionchange? Or is there an altogether different way that I can use to make the onRowClick event work with the extendedDataTable to process a selection?