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]
# 1
Please show some code.
pringia at 2007-7-14 16:39:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

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>

polo1111a at 2007-7-14 16:39:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

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...

Ragin_Trajana at 2007-7-14 16:39:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Grab 4 commandbuttons, add 4 simple actions to the backing bean and you've your own pager :)Check http://balusc.xs4all.nl/srv/dev-jep-dat.html#PagingDatatable for an basic example.
BalusCa at 2007-7-14 16:39:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

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.

Ragin_Trajana at 2007-7-14 16:39:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...