Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-106

Runtime error using Tomahawk dataTable + selectBooleanCheckboxes (MyFaces 1.1.1)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.1.4-SNAPSHOT
    • None
    • Extended Datatable
    • None
    • Windows XP Prof., jboss-4.0.1sp1 for the J2EE? 1.4 codebase

    Description

      I have a problem with the Tomahawk dataTable component, in conjunction with
      a selectBooleanCheckbox in each row. I use a Component-Binding for each component, and determining the selected
      checkboxes works well. But after that, I get the following runtime error:

      null
      java.lang.NullPointerException
      at org.apache.myfaces.component.html.ext.HtmlDataTableHack.restoreDescendantComponentStates(HtmlDataTableHack.java:245)
      at org.apache.myfaces.component.html.ext.HtmlDataTableHack.restoreDescendantComponentStates(HtmlDataTableHack.java:257)
      at org.apache.myfaces.component.html.ext.HtmlDataTableHack.setRowIndex(HtmlDataTableHack.java:200)
      at org.apache.myfaces.component.html.ext.HtmlDataTable.setRowIndex(HtmlDataTable.java:166)
      at javax.faces.component.html.HtmlDataTable.encodeBegin(HtmlDataTable.java:35)
      at org.apache.myfaces.component.html.ext.HtmlDataTableHack.encodeBegin(HtmlDataTableHack.java:126)
      at org.apache.myfaces.component.html.ext.HtmlDataTable.encodeBegin(HtmlDataTable.java:312)
      at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:441)
      at org.apache.myfaces.renderkit.RendererUtils.renderChildren(RendererUtils.java:427)
      at org.apache.myfaces.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:62)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331)
      at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:450)
      at org.apache.myfaces.custom.tabbedpane.HtmlTabbedPaneRenderer.writeTabsContents(HtmlTabbedPaneRenderer.java:535)
      at org.apache.myfaces.custom.tabbedpane.HtmlTabbedPaneRenderer.encodeEnd(HtmlTabbedPaneRenderer.java:227)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:331)
      at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:349)
      at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:253)
      at org.apache.myfaces.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:55)
      at org.apache.jsp.Management.ManagementHome_jsp._jspx_meth_t_panelTabbedPane_0(ManagementHome_jsp.java:302)
      at org.apache.jsp.Management.ManagementHome_jsp._jspx_meth_h_form_0(ManagementHome_jsp.java:238)
      at org.apache.jsp.Management.ManagementHome_jsp._jspx_meth_f_view_0(ManagementHome_jsp.java:191)
      at org.apache.jsp.Management.ManagementHome_jsp._jspService(ManagementHome_jsp.java:145)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
      at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
      at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:150)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:534)

      ----------------
      Part of JSP:
      ----------------

      <t:dataTable id="dataTableUmfragen"
      binding="#

      {UmfrageBacking.dataTable}

      "
      lang="de"
      title="Tabelle zur Auswahl eigener Umfragen"
      summary="Tabelle zur Übersicht und Auswahl eigener Umfragen"
      value="#

      {UmfrageBacking.durchfuehrungen}

      "
      var="row"
      rows="10"
      renderedIfEmpty="true"
      preserveDataModel="false"
      preserveSort="true"
      sortColumn="#

      {UmfrageBacking.sortColumn}

      "
      sortAscending="#

      {UmfrageBacking.sortAscending}

      "
      styleClass=""
      headerClass=""
      footerClass=""
      rowClasses=""
      columnClasses=""
      rowOnMouseOver="this.style.backgroundColor='#A5CBFF'"
      rowOnMouseOut="this.style.backgroundColor='#FFFFE0'"
      rowOnClick="this.style.backgroundColor='#FFE0E0'"
      rowOnDblClick="this.style.backgroundColor='#E0E0E0'"
      width="700">

      <t:column width="30">
      <h:selectBooleanCheckbox binding="#

      {UmfrageBacking.checkbox}

      "
      title="Umfrage auswählen zur Ausführung einer Aktion" />
      </t:column>

      <t:column>
      <f:facet name="header">
      <t:commandSortHeader
      columnName="#

      {UmfrageBacking.colName_Bezeichnung}"
      arrow="true"
      lang="de"
      title="#{managementBundle.sort_message}">
      <h:outputText value="#{UmfrageBacking.colName_Bezeichnung}

      "/>
      </t:commandSortHeader>
      </f:facet>
      <h:commandLink action="#

      {UmfrageBacking.edit}

      ">
      <h:outputText value="#

      {row.bezeichnung}

      "/>
      </h:commandLink>
      </t:column>
      ....
      </t:dataTable>

      ------------------------------
      Part of Backing-Bean:
      ------------------------------

      // Declarations for the component bindings
      private UIData dataTable;
      private UISelectBoolean checkbox;

      // action method to delete the selected items
      public String delete() {
      List currentUmfragen = (List)this.durchfuehrungen.getWrappedData();
      List toDelete = this.getSelectedDurchfuehrungen();
      int size = toDelete.size();
      for (int i = 0; i < size; i++)

      { currentUmfragen.remove(toDelete.get(i)); }


      return Constants.ACTION_SUCCESS;
      }

      // method to determine the selected items
      private List getSelectedDurchfuehrungen() {
      List selected = new ArrayList();
      int first = this.dataTable.getFirst();
      int rows = this.dataTable.getRows();
      for (int i = first; i < (first + rows); i++) {
      this.dataTable.setRowIndex;
      if (this.checkbox.isSelected())

      { selected.add(this.dataTable.getRowData()); }

      }
      return selected;
      }

      Attachments

        Issue Links

          Activity

            People

              lu4242 Leonardo Uribe
              maka Matthias Kahlau
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: