Hi Geeta,
Can you explain what the rowId signifies in the data table when using
the paging component?
I'm still getting errors (see below, but I think it's still pretty
basic). I added the basic.css to the JSP directory, but that didn't
help.
<t:dataTable
id = "Data"
value="#{TD.txs}"
rows="10"
styleClass="orders"
headerClass="ordersHeader"
rowClasses="evenRow,oddRow"
width="100%"
var="tx"
rowId="#(tx.type}"
sortColumn="#{TD.sortColumn}"
sortAscending="#{TD.ascending}"
preserveDataModel="true" preserveSort="true">
And, my paging header:
<t:dataScroller
id="scroll_1"
for=""
fastStep="10"
pageCountVar="pageCount"
pageIndexVar="pageIndex"
styleClass="scroller"
paginator="true"
paginatorMaxPages="9"
paginatorTableClass="paginator"
paginatorActiveColumnStyle="font-weight:bold;">
<f:actionListener
type="DataScrollerActionListener" />
<f:facet name="first">
<t:graphicImage
url="" border="1" />
</f:facet>
<f:facet name="last">
<t:graphicImage
url="" border="1" />
</f:facet>
<f:facet name="previous">
<t:graphicImage
url="" border="1" />
</f:facet>
<f:facet name="next">
<t:graphicImage
url="" border="1" />
</f:facet>
<f:facet name="fastforward">
<t:graphicImage
url="" border="1" />
</f:facet>
<f:facet name="fastrewind">
<t:graphicImage
url="" border="1" />
</f:facet>
</t:dataScroller>
</h:panelGrid>
type Exception report
message
description The server encountered an internal error ()
that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: javax.servlet.ServletException: javax.servlet.jsp.JspException: null
javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
root cause
javax.faces.FacesException: javax.servlet.ServletException: javax.servlet.jsp.JspException: null
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:327)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
Thanks
Mike
[EMAIL PROTECTED] wrote:
Mike <[EMAIL PROTECTED]> wrote on
01/03/2006 10:00:30 AM:
> Hello all,
>
> I think I've almost gotten the paging component working with the
> sorting component for an ArrayList-based data model.
>
> If I remove the paging part from the JSP, the page still sorts and
> saves correctly.
>
> But, when I add the paging logic into the JSP, I get this message,
> which really doesn't help much. The log does refer to the JSP
page,
> but the line number is bigger than the actual number of lines in
the
> file so that's not helpful either.
Hi Mike,
Here's a barebones paging code (I removed all
style
for simplicity) which works for me:
<h:form
id="contactscrollerpagerform">
<t:saveState
id="savesearchstate"
value="#{search}"
/>
<h:panelGrid
styleClass="scrollerTableNoBorder"
rendered="#{search.results}">
<h:column>
<h:panelGrid
id="contactInfoPanelGrid">
<f:facet
name="header">
<h:outputText
value="Demographic
search results" />
</f:facet>
<t:dataTable
id="contactsearchdata"
var="contact"
value="#{search.matchingContacts}"
rows="7"
rowId="#{contact.id}"
sortColumn="#{search.sort}"
sortAscending="#{search.ascending}"
preserveSort="true">
<h:column>
<f:facet
name="header">
<t:commandSortHeader
columnName="lastname"
arrow="true"
immediate="false">
<h:outputText
value="Last
Name" />
</t:commandSortHeader>
</f:facet>
<h:outputText
value="#{contact.lastName}"
/>
</h:column>
<!--etc..add other
columns here..-->
</t:dataTable>
</h:panelGrid>
<h:panelGrid>
<t:dataScroller
id="scroll_1"
for="contactsearchdata"
fastStep="10"
pageCountVar="pageCount"
pageIndexVar="pageIndex"
paginator="true"
paginatorMaxPages="3"
paginatorTableClass="paginator"
paginatorActiveColumnStyle="font-weight:bold;">
<f:facet
name="first">
<t:graphicImage
url="images/arrow-first.gif"
border="1"
/>
</f:facet>
<f:facet
name="last">
<t:graphicImage
url="images/arrow-last.gif"
border="1"
/>
</f:facet>
<f:facet
name="previous">
<t:graphicImage
url="images/arrow-previous.gif"
border="1"
/>
</f:facet>
<f:facet
name="next">
<t:graphicImage
url="images/arrow-next.gif"
border="1"
/>
</f:facet>
</t:dataScroller>
</h:panelGrid>
</h:column>
</h:panelGrid>
</h:form>
You are right about the "for" of the datascroller
needing to match the "id" of the datatable. Also note I didn't
have have any actionListeners at all. Plus, the style stuff is in
basic.css
(at least it was in the version i downloaded a little while back. So as
long as you import that style sheet at the top of your jsp, the style
will
be picked up.
Hope this helps,
Geeta
|
- Re: Paging Control -- Help Mike
-