One more thing. When binding="#{listRodzajePism.jsfDataTable}" is removed
from x:datatable tag, everyhing works just fine.

PK

-----Original Message-----
From: Kołoszko Paweł 
Sent: Thursday, August 18, 2005 11:20 AM
To: [email protected]
Subject: FacesException: Could not get property rows of component...

MyFaces 1.0.9

I have a following problem:
 
I have page.jsp with datatable and a button:
 
<x:dataTable id="listarodzajepism" value="#{listRodzajePism.rodzajePism}"
var="rodzajPisma" border="0" 
                styleClass="standardTable"
headerClass="standardTable_SortHeader"
rowClasses="standardTable_Row1,standardTable_Row2"
footerClass="standardTable_Footer"
sortColumn="#{listRodzajePism.sort}"
sortAscending="#{listRodzajePism.ascending}"
                preserveDataModel="true"
                preserveSort="true"
                rows="24"
binding="#{listRodzajePism.jsfDataTable}">

... column, column, column ...
</x:dataTable>
<h:commandButton id="cb" value="NewPage" action="newpage"/>

Action "newpage" of commandbutton opens page2.jsp with only one button:

<h:commandButton id="button" 
                value="Cancel"
action="back"
immediate="true"/>

Action "back" goes back to page.jsp. And here the problem occurs becuase I
receive an error:

javax.faces.FacesException: Could not get property rows of component
rodzajepismview:listarodzajepism Caused by: java.lang.NullPointerException
        at
org.apache.myfaces.component.html.ext.HtmlDataTable.getRows(HtmlDataTable.ja
va:547)

When I open page.jsp everything is OK, but action page.jsp -> page2.jsp ->
page.jsp Cause an error.

In my backing bean I have:

        private HtmlDataTable jsfDataTable;

    public HtmlDataTable getJsfDataTable() {
        return jsfDataTable;
    }
    
    public void setJsfDataTable(HtmlDataTable jsfDataTable) {
        this.jsfDataTable = jsfDataTable;
    }

What can cause this problem? Is it a bug in MyFaces or my fault somewher in
my code?

PK

Reply via email to