Example of TableCellSelectedListener

Top  Previous  Next

package testingapplication.table;

 

import com.softaspects.jsf.component.table.event.*;

import com.softaspects.jsf.component.table.listener.*;

import com.softaspects.jsf.component.table.*;

 

import javax.faces.event.AbortProcessingException;

 

public class MyTableCellSelectedListener implements TableCellSelectedListener {

 

       public MyTableCellSelectedListener() {

       }

 

       public void processTableCellSelected(TableCellSelectedEvent event)

              throws AbortProcessingException {

               System.out.println("MyCellSelectedListener called ! " +

                      "Component id = " + event.getComponent().getId());

               System.out.println("First selected row = " +

                      ((Table)event.getComponent()).getSelectedRows()[0]);

       }

}