Pager doesn't work
Hello, I want to use a pager for an arraylist. Showing the first 10 records isn't a problem. But clicking to the next page directs to the error:
Caused by: javax.faces.el.ReferenceSyntaxException: The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer.
Anyone an idea how to solve this problem?
[419 byte] By [
polo1111a] at [2007-10-2 23:53:49]

Sorry I forgot:
<h:dataTable border="0" cellpadding="2"
cellspacing="0" columnClasses="columnClass1"
headerClass="headerClass" footerClass="footerClass"
rowClasses="rowClass1" styleClass="dataTable" id="table1"
value="#{schadenhistorie.schaeden}" var="varschaeden"
style="border-bottom-style: none; border-left-style: none; border-right-style: none; border-style: none; border-top-style: none" rows="10">
<h:column id="column3">
<f:facet name="header">
<h:outputText styleClass="outputText" value="ID" id="text13"></h:outputText>
</f:facet>
<h:outputText id="text15" value="#{varschaeden.schadenid}"
styleClass="outputText">
</h:outputText>
<f:attribute value="10" name="width" />
</h:column>
<f:facet name="footer">
<hx:panelBox styleClass="panelBox" id="box1">
<hx:pagerDeluxe styleClass="pagerDeluxe" id="deluxe1" />
<hx:pagerGoto styleClass="pagerGoto" id="goto1" />
</hx:panelBox>
</f:facet>
</h:dataTable>
I have exactly the same problem... Let me know if you get anywhere...
My exception was:
javax.faces.el.ReferenceSyntaxException: The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer.
<h:dataTable rows="5" border="0" value="#{contactList.contacts}" var="contact">
If I take out the var setting, it works without an exception, but gives me the same value in each row, which isn't correct behavior...
Ok,
I finally have my code working. I was using hibernate to do a basic select statement, with code similar to this:
private List clues = null;
public List getClues(){
Sessionsession= HibernateSessionFactory.getSession();
Queryquery= session.createQuery( "select clue.clue1, clue.clue2, clue.clue3 from Clue clue" );
clues = query.list();
}
I used the same expression language notation as I have found in every Java Server Faces example in every book I've seen, or web page for that matter.
In other words, for the output value, I would have done:
var="someVar"
<h:outputText value="#{someVar.clue1}"/>
Since that was consistent with all the examples I had read, I figured I'd get a result. What I encountered was the following:
javax.faces.el.ReferenceSyntaxException: The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer.
What finally worked was dumping the dot notation, and referencing the index directly.
<h:outputText value="#{someVar[0]}"/>
Referencing its postion in the ArrayList returned it accurately every single time. If I encounter errors, I'll let you know.