title: FacesException: DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled
body: <p>I am trying to learn PF so I started with displaying datatable first and navigating to next page on rowClick passing parameters, but got stuck with the following error. I found similar problem for that question but no luck yet. I hope somebody will help me out.</p>
  
  <p>I am getting following error:</p>
  
  <pre><code>DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled.
  
  Caused by:
  javax.faces.FacesException - DataModel must implement org.primefaces.model.SelectableDataModel when selection is enabled.
  </code></pre>
  
  <p>my Page:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"&gt;
  
  &lt;h:head&gt;
  &lt;title&gt;Primefaces 3.1&lt;/title&gt;
  
  &lt;/h:head&gt;
  &lt;h:body&gt;
      &lt;h:form id="form"&gt;          
              &lt;p:dataTable value="#{tableBean.cars}" var="var" rowkey="#{var.model}" 
              selection="#{tableBean.car}" selectionMode="single"&gt;
              &lt;p:column&gt;  &lt;f:facet name="header"&gt;
                                  &lt;h:outputText styleClass="outputText" value="Model"&gt;&lt;/h:outputText&gt;
                              &lt;/f:facet&gt;
                              &lt;h:outputText styleClass="outputText"
                                  value="#{var.model}"&gt;&lt;/h:outputText&gt;
                          &lt;/p:column&gt;
                          &lt;p:column&gt;
                              &lt;f:facet name="header"&gt;
                                  &lt;h:outputText styleClass="outputText" value="Color"&gt;&lt;/h:outputText&gt;
                              &lt;/f:facet&gt;
                              &lt;h:outputText styleClass="outputText"
                                  value="#{var.randomColor}"&gt;&lt;/h:outputText&gt;
                          &lt;/p:column&gt;&lt;/p:dataTable&gt;                               
          &lt;/h:form&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my bean Classes:</p>
  
  <pre><code>@ManagedBean
  @ViewScoped
  public class TableBean extends ListDataModel&lt;Car&gt; implements SelectableDataModel&lt;Car&gt;{
  
      private List&lt;Car&gt; cars;
      private Car car;
  
      public List&lt;Car&gt; getCars() {
  
          cars = new ArrayList&lt;Car&gt;();
          Car car1 = new Car();
          car1.setModel("BMW");
          car1.setRandomColor("Black");
          cars.add(car1);
          Car car2 = new Car();       
          car2.setModel("Audi");
          car2.setRandomColor("White");
          cars.add(car2);
  
          return cars;
      }
  
      public String onRowSelect(){
          System.out.println("Row Click!!!");
          return "otherpage";//Does this nav works???if not how???
      }
  
      public Car getCar() {
          return car;
      }
  
      @Override
      public Car getRowData(String pArg0) {
          // TODO Auto-generated method stub
          return null;
      }
  
      @Override
      public Object getRowKey(Car pArg0) {
          // TODO Auto-generated method stub
          return null;
      }   
      }
  </code></pre>
  
  <p>OtherBean:</p>
  
  <pre><code>public class Car{
  
      private String model;   
      private String randomColor; 
  
      public String getRandomColor() {
          return randomColor;
      }
      public void setRandomColor(String pRandomColor) {
          randomColor = pRandomColor;
      }
  
      public String getModel() {
          return model;
      }
      public void setModel(String pModel) {
          model = pModel;
      }
  
  }
  </code></pre>