FAQ
Hi guys,

I have a dataTable that only filled after execute a method on my bean,
this table uses sorting using this code:

<t:dataTable
var="item"
value="#{bean.results}"
preserveDataModel="false"
renderedIfEmpty="false"
sortable="true"
sortColumn="#{bean.sortColumn}"
sortAscending="#{bean.sortAscending}"
preserveSort="true"
rows="10"
>

<t:column defaultSorted="true">
<f:facet name="header">
<h:outputText value="ID" />
</f:facet>
<h:outputText value="#{item.id}" />
</t:column>

</t:dataTable>

and this bean:

public abstract class Bean
{
//Variaveis de uso interno do bean
private String keyword;
private String sortColumn = null;
private boolean sortAscending = true;
private List results;

...

getters and setters
...

public String search()
{
results = new ArrayList();
...
fill results ArrayList with some entity instances
...
}
}

but when i load the page i get this error:

java.lang.NullPointerException: value
at javax.faces.component._ComponentChildrenList.checkValue
(_ComponentChildrenList.java:93)
at javax.faces.component._ComponentChildrenList.add
(_ComponentChildrenList.java:61)
at
org.apache.myfaces.component.html.ext.HtmlDataTable.createSortHeaderComponent
(HtmlDataTable.java:538)
at org.apache.myfaces.component.html.ext.HtmlDataTable.encodeBegin(
HtmlDataTable.java:490)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
ComponentSupport.java:232)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
ComponentSupport.java:239)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
ComponentSupport.java:239)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
ComponentSupport.java:239)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
ComponentSupport.java:239)
at com.sun.facelets.FaceletViewHandler.renderView(
FaceletViewHandler.java:580)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java
:384)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(
ExtensionsFilter.java:181)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)

Any ideas?

--
Yours truly (Atenciosamente),

Rogério

Search Discussions

  • Rogerio Pereira at Jul 19, 2006 at 12:28 pm
    The real problem is, i have columns that doesn´t have the header facet.

    2006/7/19, Rogerio Pereira <rogerio.araujo@gmail.com>:
    Hi guys,

    I have a dataTable that only filled after execute a method on my bean,
    this table uses sorting using this code:

    <t:dataTable
    var="item"
    value="#{bean.results}"
    preserveDataModel="false"
    renderedIfEmpty="false"
    sortable="true"
    sortColumn="#{bean.sortColumn}"
    sortAscending="#{bean.sortAscending}"
    preserveSort="true"

    rows="10"
    <t:column defaultSorted="true">
    <f:facet name="header">
    <h:outputText value="ID" />
    </f:facet>
    <h:outputText value="#{ item.id}" />
    </t:column>

    </t:dataTable>

    and this bean:

    public abstract class Bean
    {
    //Variaveis de uso interno do bean
    private String keyword;
    private String sortColumn = null;
    private boolean sortAscending = true;
    private List results;

    ...

    getters and setters
    ...

    public String search()
    {
    results = new ArrayList();
    ...
    fill results ArrayList with some entity instances
    ...
    }
    }

    but when i load the page i get this error:

    java.lang.NullPointerException : value
    at javax.faces.component._ComponentChildrenList.checkValue
    (_ComponentChildrenList.java:93)
    at javax.faces.component._ComponentChildrenList.add
    (_ComponentChildrenList.java:61)
    at
    org.apache.myfaces.component.html.ext.HtmlDataTable.createSortHeaderComponent(
    HtmlDataTable.java:538)
    at org.apache.myfaces.component.html.ext.HtmlDataTable.encodeBegin(
    HtmlDataTable.java:490)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
    ComponentSupport.java:232)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
    ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
    ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive (
    ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
    ComponentSupport.java:239)
    at com.sun.facelets.FaceletViewHandler.renderView(
    FaceletViewHandler.java:580)
    at org.apache.myfaces.lifecycle.LifecycleImpl.render (
    LifecycleImpl.java:384)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter (
    ApplicationFilterChain.java:173)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(
    ExtensionsFilter.java:181)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java :202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(
    StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke (
    StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(
    StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(
    ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke (
    StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(
    CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(
    Http11Processor.java:869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(
    Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
    PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
    LeaderFollowerWorkerThread.java :80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
    ThreadPool.java:684)
    at java.lang.Thread.run(Unknown Source)

    Any ideas?

    --
    Yours truly (Atenciosamente),

    Rogério


    --
    Yours truly (Atenciosamente),

    Rogério
  • Catalin Kormos at Jul 19, 2006 at 1:08 pm
    Yeah, it needs the header facet to be there, so looks like a bug. Could you open a Jira issue for this?

    Thanks,
    Catalin

    Rogerio Pereira wrote: The real problem is, i have columns that doesn�t have the header facet.

    2006/7/19, Rogerio Pereira <rogerio.araujo@gmail.com>: Hi guys,

    I have a dataTable that only filled after execute a method on my bean, this table uses sorting using this code:

    <t:dataTable
    var="item"
    value="#{bean.results}"
    preserveDataModel="false"
    renderedIfEmpty="false"
    sortable="true"
    sortColumn="#{bean.sortColumn}"
    sortAscending="#{bean.sortAscending}"
    preserveSort="true"
    rows="10"
    >

    <t:column defaultSorted="true">
    <f:facet name="header">
    <h:outputText value="ID" />
    </f:facet>
    <h:outputText value="#{ item.id}" />
    </t:column>

    </t:dataTable>

    and this bean:

    public abstract class Bean
    {
    //Variaveis de uso interno do bean
    private String keyword;
    private String sortColumn = null;
    private boolean sortAscending = true;
    private List results;

    ...

    getters and setters
    ...

    public String search()
    {
    results = new ArrayList();
    ...
    fill results ArrayList with some entity instances
    ...
    }
    }

    but when i load the page i get this error:

    java.lang.NullPointerException : value
    at javax.faces.component._ComponentChildrenList.checkValue(_ComponentChildrenList.java:93)
    at javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:61)
    at org.apache.myfaces.component.html.ext.HtmlDataTable.createSortHeaderComponent (HtmlDataTable.java:538)
    at org.apache.myfaces.component.html.ext.HtmlDataTable.encodeBegin(HtmlDataTable.java:490)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive (ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
    at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
    at org.apache.myfaces.lifecycle.LifecycleImpl.render (LifecycleImpl.java:384)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:173)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:181)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java :202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection (Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java :80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Unknown Source)

    Any ideas?


    --
    Yours truly (Atenciosamente),

    Rog�rio




    --
    Yours truly (Atenciosamente),

    Rog�rio


    ---------------------------------
    Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1&cent;/min.
  • Rogerio Pereira at Jul 19, 2006 at 1:31 pm
    Now i could load and fill the dataTable, but when i click in sort links
    nothing happens, i need set preserveDataModel="true" in order to get sorting
    working?



    2006/7/19, Catalin Kormos <catalean@yahoo.com>:
    Yeah, it needs the header facet to be there, so looks like a bug. Could
    you open a Jira issue for this?

    Thanks,
    Catalin


    *Rogerio Pereira wrote:

    The real problem is, i have columns that doesn�t have the header facet.

    2006/7/19, Rogerio Pereira <rogerio.araujo@gmail.com>:
    Hi guys,
    I have a dataTable that only filled after execute a method on my bean,
    this table uses sorting using this code:

    <t:dataTable
    var="item"
    value="#{bean.results}"
    preserveDataModel="false"
    renderedIfEmpty="false"
    sortable="true"
    sortColumn="#{bean.sortColumn}"
    sortAscending="#{bean.sortAscending}"
    preserveSort="true"

    rows="10"
    <t:column defaultSorted="true">
    <f:facet name="header">
    <h:outputText value="ID" />
    </f:facet>
    <h:outputText value="#{ item.id}" />
    </t:column>

    </t:dataTable>

    and this bean:

    public abstract class Bean
    {
    //Variaveis de uso interno do bean
    private String keyword;
    private String sortColumn = null;
    private boolean sortAscending = true;
    private List results;

    ...

    getters and setters
    ...

    public String search()
    {
    results = new ArrayList();
    ...
    fill results ArrayList with some entity instances
    ...
    }
    }

    but when i load the page i get this error:

    java.lang.NullPointerException : value
    at javax.faces.component._ComponentChildrenList.checkValue
    (_ComponentChildrenList.java:93)
    at javax.faces.component._ComponentChildrenList.add
    (_ComponentChildrenList.java:61)
    at
    org.apache.myfaces.component.html.ext.HtmlDataTable.createSortHeaderComponent(
    HtmlDataTable.java:538)
    at org.apache.myfaces.component.html.ext.HtmlDataTable.encodeBegin(
    HtmlDataTable.java:490)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
    ComponentSupport.java:232)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
    ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
    ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive (
    ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
    ComponentSupport.java:239)
    at com.sun.facelets.FaceletViewHandler.renderView(
    FaceletViewHandler.java:580)
    at org.apache.myfaces.lifecycle.LifecycleImpl.render (
    LifecycleImpl.java:384)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter (
    ApplicationFilterChain.java:173)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(
    ExtensionsFilter.java:181)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java :202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(
    StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke (
    StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(
    StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(
    ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke (
    StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(
    CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(
    Http11Processor.java:869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(
    Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
    PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
    LeaderFollowerWorkerThread.java :80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
    ThreadPool.java:684)
    at java.lang.Thread.run(Unknown Source)

    Any ideas?

    --
    Yours truly (Atenciosamente),

    Rog�rio



    --
    Yours truly (Atenciosamente),

    Rog�rio

    ------------------------------
    Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates
    starting at 1¢/min.
    <http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com>

    --
    Yours truly (Atenciosamente),

    Rogério
  • Catalin Kormos at Jul 19, 2006 at 3:14 pm
    You don't need preserveDataModel="true" to make the auto sorting work. What you could do is set the sort properties manualy for each column, maybe the dataTable wasn't enable to determine them right.

    Rogerio Pereira wrote: Now i could load and fill the dataTable, but when i click in sort links nothing happens, i need set preserveDataModel="true" in order to get sorting working?



    2006/7/19, Catalin Kormos < catalean@yahoo.com>:Yeah, it needs the header facet to be there, so looks like a bug. Could you open a Jira issue for this?

    Thanks,
    Catalin


    Rogerio Pereira wrote:

    The real problem is, i have columns that doesn�t have the header facet.



    2006/7/19, Rogerio Pereira < rogerio.araujo@gmail.com>:

    Hi guys,

    I have a dataTable that only filled after execute a method on my bean, this table uses sorting using this code:

    <t:dataTable
    var="item"
    value="#{bean.results}"
    preserveDataModel="false"
    renderedIfEmpty="false"
    sortable="true"
    sortColumn="#{bean.sortColumn}"
    sortAscending="#{bean.sortAscending}"
    preserveSort="true"
    rows="10"
    >

    <t:column defaultSorted="true">
    <f:facet name="header">
    <h:outputText value="ID" />
    </f:facet>
    <h:outputText value="#{ item.id}" />
    </t:column>

    </t:dataTable>

    and this bean:

    public abstract class Bean
    {
    //Variaveis de uso interno do bean
    private String keyword;
    private String sortColumn = null;
    private boolean sortAscending = true;
    private List results;

    ...

    getters and setters
    ...

    public String search()
    {
    results = new ArrayList();
    ...
    fill results ArrayList with some entity instances
    ...
    }
    }

    but when i load the page i get this error:

    java.lang.NullPointerException : value
    at javax.faces.component._ComponentChildrenList.checkValue(_ComponentChildrenList.java:93)
    at javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:61)
    at org.apache.myfaces.component.html.ext.HtmlDataTable.createSortHeaderComponent (HtmlDataTable.java:538)
    at org.apache.myfaces.component.html.ext.HtmlDataTable.encodeBegin(HtmlDataTable.java:490)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive (ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
    at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
    at org.apache.myfaces.lifecycle.LifecycleImpl.render (LifecycleImpl.java:384)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:173)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:181)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java :202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection (Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java :80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java :684)
    at java.lang.Thread.run(Unknown Source)

    Any ideas?



    --
    Yours truly (Atenciosamente),

    Rog�rio




    --
    Yours truly (Atenciosamente),

    Rog�rio



    ---------------------------------
    Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.





    --
    Yours truly (Atenciosamente),

    Rogério


    ---------------------------------
    Do you Yahoo!?
    Next-gen email? Have it all with the all-new Yahoo! Mail Beta.
  • Rogerio Pereira at Jul 19, 2006 at 4:10 pm
    Now i have only this exception:

    java.lang.ClassCastException:
    org.apache.myfaces.component.html.ext.SortableModel
    at
    org.apache.myfaces.component.html.ext.HtmlDataTable.updateModelFromPreservedDataModel
    (HtmlDataTable.java:399)
    at org.apache.myfaces.component.html.ext.HtmlDataTable.processUpdates(
    HtmlDataTable.java:385)
    at javax.faces.component.UIForm.processUpdates(UIForm.java:87)
    at javax.faces.component.UIComponentBase.processUpdates(
    UIComponentBase.java:645)
    at javax.faces.component.UIComponentBase.processUpdates(
    UIComponentBase.java:645)
    at javax.faces.component.UIComponentBase.processUpdates(
    UIComponentBase.java:645)
    at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:157)
    at org.apache.myfaces.lifecycle.LifecycleImpl.updateModelValues(
    LifecycleImpl.java:302)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java
    :81)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(
    ExtensionsFilter.java:181)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(
    StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(
    StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(
    StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(
    ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(
    StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(
    CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
    :869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
    (Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
    PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
    LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
    ThreadPool.java:684)
    at java.lang.Thread.run(Unknown Source)

    2006/7/19, Catalin Kormos <catalean@yahoo.com>:
    You don't need preserveDataModel="true" to make the auto sorting work.
    What you could do is set the sort properties manualy for each column, maybe
    the dataTable wasn't enable to determine them right.

    *Rogerio Pereira wrote:

    Now i could load and fill the dataTable, but when i click in sort links
    nothing happens, i need set preserveDataModel="true" in order to get sorting
    working?



    2006/7/19, Catalin Kormos < catalean@yahoo.com>:
    Yeah, it needs the header facet to be there, so looks like a bug. Could
    you open a Jira issue for this?

    Thanks,
    Catalin


    *Rogerio Pereira wrote:

    The real problem is, i have columns that doesn�t have the header facet.

    2006/7/19, Rogerio Pereira < rogerio.araujo@gmail.com>:
    Hi guys,
    I have a dataTable that only filled after execute a method on my bean,
    this table uses sorting using this code:

    <t:dataTable
    var="item"
    value="#{bean.results}"
    preserveDataModel="false"
    renderedIfEmpty="false"
    sortable="true"
    sortColumn="#{bean.sortColumn}"
    sortAscending="#{bean.sortAscending}"
    preserveSort="true"

    rows="10"
    <t:column defaultSorted="true">
    <f:facet name="header">
    <h:outputText value="ID" />

    </f:facet>
    <h:outputText value="#{ item.id}" />
    </t:column>

    </t:dataTable>

    and this bean:

    public abstract class Bean
    {
    //Variaveis de uso interno do bean
    private String keyword;
    private String sortColumn = null;
    private boolean sortAscending = true;
    private List results;

    ...

    getters and setters
    ...

    public String search()
    {
    results = new ArrayList();
    ...
    fill results ArrayList with some entity instances
    ...
    }
    }

    but when i load the page i get this error:

    java.lang.NullPointerException : value
    at javax.faces.component._ComponentChildrenList.checkValue
    (_ComponentChildrenList.java:93)
    at javax.faces.component._ComponentChildrenList.add
    (_ComponentChildrenList.java:61)
    at
    org.apache.myfaces.component.html.ext.HtmlDataTable.createSortHeaderComponent(
    HtmlDataTable.java:538)
    at org.apache.myfaces.component.html.ext.HtmlDataTable.encodeBegin(
    HtmlDataTable.java:490)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
    ComponentSupport.java:232)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
    ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
    ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive (
    ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(
    ComponentSupport.java:239)
    at com.sun.facelets.FaceletViewHandler.renderView(
    FaceletViewHandler.java:580)
    at org.apache.myfaces.lifecycle.LifecycleImpl.render (
    LifecycleImpl.java:384)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter (
    ApplicationFilterChain.java:173)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(
    ExtensionsFilter.java:181)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    ApplicationFilterChain.java :202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter (
    ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(
    StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke (
    StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(
    StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(
    ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke (
    StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(
    CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(
    Http11Processor.java:869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(
    Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (
    PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
    LeaderFollowerWorkerThread.java :80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
    ThreadPool.java :684)
    at java.lang.Thread.run(Unknown Source)

    Any ideas?

    --
    Yours truly (Atenciosamente),

    Rog�rio



    --
    Yours truly (Atenciosamente),

    Rog�rio

    ------------------------------
    Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great
    rates starting at 1¢/min.
    <http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com>


    --
    Yours truly (Atenciosamente),

    Rogério


    ------------------------------
    Do you Yahoo!?
    Next-gen email? Have it all with the all-new Yahoo! Mail Beta.<http://us.rd.yahoo.com/evt=40788/*http://advision.webevents.yahoo.com/handraisers>

    --
    Yours truly (Atenciosamente),

    Rogério
  • Catalin Kormos at Jul 19, 2006 at 4:31 pm
    Ok, so you did set preserveDataModel to true after all, right? i can't imagine this happening if you set it to false.

    Rogerio Pereira wrote: Now i have only this exception:

    java.lang.ClassCastException: org.apache.myfaces.component.html.ext.SortableModel
    at org.apache.myfaces.component.html.ext.HtmlDataTable.updateModelFromPreservedDataModel(HtmlDataTable.java :399)
    at org.apache.myfaces.component.html.ext.HtmlDataTable.processUpdates(HtmlDataTable.java:385)
    at javax.faces.component.UIForm.processUpdates(UIForm.java:87)
    at javax.faces.component.UIComponentBase.processUpdates (UIComponentBase.java:645)
    at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:645)
    at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:645)
    at javax.faces.component.UIViewRoot.processUpdates (UIViewRoot.java:157)
    at org.apache.myfaces.lifecycle.LifecycleImpl.updateModelValues(LifecycleImpl.java:302)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:81)
    at javax.faces.webapp.FacesServlet.service (FacesServlet.java:137)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java :173)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:181)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection (Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java :80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Unknown Source)

    2006/7/19, Catalin Kormos < catalean@yahoo.com>:You don't need preserveDataModel="true" to make the auto sorting work. What you could do is set the sort properties manualy for each column, maybe the dataTable wasn't enable to determine them right.

    Rogerio Pereira wrote: Now i could load and fill the dataTable, but when i click in sort links nothing happens, i need set preserveDataModel="true" in order to get sorting working?



    2006/7/19, Catalin Kormos < catalean@yahoo.com>: Yeah, it needs the header facet to be there, so looks like a bug. Could you open a Jira issue for this?

    Thanks,
    Catalin


    Rogerio Pereira wrote:

    The real problem is, i have columns that doesn�t have the header facet.



    2006/7/19, Rogerio Pereira < rogerio.araujo@gmail.com >:

    Hi guys,

    I have a dataTable that only filled after execute a method on my bean, this table uses sorting using this code:

    <t:dataTable
    var="item"
    value="#{bean.results}"
    preserveDataModel="false"
    renderedIfEmpty="false"
    sortable="true"
    sortColumn="#{bean.sortColumn}"
    sortAscending="#{bean.sortAscending }"
    preserveSort="true"
    rows="10"
    >

    <t:column defaultSorted="true">
    <f:facet name="header">
    <h:outputText value="ID" />
    </f:facet>
    <h:outputText value="#{ item.id}" />
    </t:column>

    </t:dataTable>

    and this bean:

    public abstract class Bean
    {
    //Variaveis de uso interno do bean
    private String keyword;
    private String sortColumn = null;
    private boolean sortAscending = true;
    private List results;

    ...

    getters and setters
    ...

    public String search()
    {
    results = new ArrayList();
    ...
    fill results ArrayList with some entity instances
    ...
    }
    }

    but when i load the page i get this error:

    java.lang.NullPointerException : value
    at javax.faces.component._ComponentChildrenList.checkValue(_ComponentChildrenList.java:93)
    at javax.faces.component._ComponentChildrenList.add(_ComponentChildrenList.java:61)
    at org.apache.myfaces.component.html.ext.HtmlDataTable.createSortHeaderComponent (HtmlDataTable.java:538)
    at org.apache.myfaces.component.html.ext.HtmlDataTable.encodeBegin(HtmlDataTable.java:490)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive (ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive (ComponentSupport.java:239)
    at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
    at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
    at org.apache.myfaces.lifecycle.LifecycleImpl.render (LifecycleImpl.java:384)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:173)
    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter (ExtensionsFilter.java:181)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java :202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java :173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection (Http11BaseProtocol.java :664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java :80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run (ThreadPool.java :684)
    at java.lang.Thread.run(Unknown Source)

    Any ideas?



    --
    Yours truly (Atenciosamente),

    Rog�rio




    --
    Yours truly (Atenciosamente),

    Rog�rio



    ---------------------------------
    Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.





    --
    Yours truly (Atenciosamente),

    Rogério



    ---------------------------------
    Do you Yahoo!?
    Next-gen email? Have it all with the all-new Yahoo! Mail Beta.





    --
    Yours truly (Atenciosamente),

    Rogério


    ---------------------------------
    How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesmyfaces
postedJul 19, '06 at 12:06p
activeJul 19, '06 at 4:31p
posts7
users2
websitemyfaces.apache.org

2 users in discussion

Rogerio Pereira: 4 posts Catalin Kormos: 3 posts

People

Translate

site design / logo © 2018 Grokbase