title: selectionMode on primefaces dataTable
body: <p>I have a datatable inside confirmDialog, I try to put multipleSelection checkbox on it but causing error &amp; data not visible</p>
  
  <p>page:</p>
  
  <pre><code>&lt;h:form&gt;
  &lt;p:commandButton update="msgfiles" actionListener="#{globalCounter.reloadList()}"
     oncomplete="choose.show()"/&gt;
  
                  &lt;p:confirmDialog widgetVar="choose"&gt;
                      &lt;p:dataTable id="msgfiles" var="obj" rows="5" value="#{globalCounter.objectList}"
                                   rowKey="#{obj[0]}" selection="#{globalCounter.selectedObjectList}"&gt;
                          &lt;p:column selectionMode="multiple"/&gt;
                          &lt;p:column headerText="id"&gt;
                              &lt;h:outputText value="#{obj[0]}"/&gt;
                          &lt;/p:column&gt;
                          &lt;p:column headerText="name"&gt;
                              &lt;h:outputText value="#{obj[1]}"/&gt;
                          &lt;/p:column&gt;
                      &lt;/p:dataTable&gt;
                  &lt;/p:confirmDialog&gt;
              &lt;/h:form&gt;
  </code></pre>
  
  <p>bean:</p>
  
  <pre><code>import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.List;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.SessionScoped;
  
  @ManagedBean(name = "globalCounter")
  @SessionScoped
  public class TestBean implements Serializable {
  
     private List&lt;Object[]&gt; objectList;
     public List&lt;Object[]&gt; getObjectList() {
          return objectList;
      }
     public void setObjectList(List&lt;Object[]&gt; objectList) {
          this.objectList = objectList;
      }
  
      public void reloadList() {
          objectList = new ArrayList&lt;Object[]&gt;();
          objectList.add(new Object[]{"1", "one"});
          objectList.add(new Object[]{"2", "two"});
          objectList.add(new Object[]{"3", "three"});
          objectList.add(new Object[]{"4", "four"});
          objectList.add(new Object[]{"5", "five"});
      }
  
      private List&lt;Object[]&gt; selectedObjectList;
      public List&lt;Object[]&gt; getSelectedObjectList() {
          return selectedObjectList;
      }
      public void setSelectedObjectList(List&lt;Object[]&gt; selectedObjectList) {
          this.selectedObjectList = selectedObjectList;
      }
  }
  </code></pre>
  
  <p>error message:</p>
  
  <pre><code>    [#|2012-10-03T16:28:36.390+0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;|javax.faces.FacesException
     at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:86)
     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
     at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
     at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
     at atiits.filter.AuthenticateAuthorize.doFilter(AuthenticateAuthorize.java:100)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
     at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
     at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
     at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
     at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
     at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
     at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:473)
     at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:341)
     at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
     at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:161)
     at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137)
     at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
     at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
     at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
     at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
     at java.lang.Thread.run(Thread.java:619)
  Caused by: java.lang.NullPointerException
     at java.lang.reflect.Array.newArray(Native Method)
     at java.lang.reflect.Array.newInstance(Array.java:52)
     at org.primefaces.component.datatable.feature.SelectionFeature.decodeMultipleSelection(SelectionFeature.java:53)
     at org.primefaces.component.datatable.feature.SelectionFeature.decode(SelectionFeature.java:39)
     at org.primefaces.component.datatable.DataTableRenderer.decode(DataTableRenderer.java:53)
     at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:790)
     at org.primefaces.component.api.UIData.processDecodes(UIData.java:224)
     at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1042)
     at javax.faces.component.UIForm.processDecodes(UIForm.java:216)
     at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1042)
     at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1042)
     at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:941)
     at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
     ... 32 more
  |#]
  
  [#|2012-10-03T16:28:36.390+0700|WARNING|glassfish3.0.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=29;_ThreadName=http-thread-pool-8080-(1);|StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
  java.lang.NullPointerException
     at java.io.Writer.write(Writer.java:140)
     at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:200)
     at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:119)
     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
     at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
     at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
     at atiits.filter.AuthenticateAuthorize.doFilter(AuthenticateAuthorize.java:100)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
     at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
     at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
     at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
     at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
     at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
     at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:473)
     at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:341)
     at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
     at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:161)
     at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137)
     at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
     at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
     at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
     at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
     at java.lang.Thread.run(Thread.java:619)
  |#]
  
  [#|2012-10-03T16:28:36.390+0700|WARNING|glassfish3.0.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=29;_ThreadName=http-thread-pool-8080-(1);|StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
  java.lang.NullPointerException
     at java.io.Writer.write(Writer.java:140)
     at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:200)
     at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:119)
     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
     at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
     at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
     at atiits.filter.AuthenticateAuthorize.doFilter(AuthenticateAuthorize.java:100)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
     at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
     at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
     at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
     at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
     at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
     at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:473)
     at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:341)
     at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
     at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:161)
     at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137)
     at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
     at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
     at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
     at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
     at java.lang.Thread.run(Thread.java:619)
  |#]
  </code></pre>
  
  <p>If I remove <code>&lt;p:column selectionMode="multiple" style="width:18px" /&gt;</code> from the page everything is fine and data displayed</p>
  
  <p>Where did I go wrong?  </p>
  
  <p>Primefaces 3.4/ Mojarra 2.0.2 (FCS b10)/Glassfish 3.0.1</p>