Set an image for Centric CRM 4.1 (Stable and Released)

Sign In or Register

Centric CRM 4.1 (Stable and Released)

Core Team
PUBLIC PROFILE

Back to topics

Feedback (Suggestions, comments, etc.)

How do you set the "Items per page"?

You need to be logged in to post messages

This question is unanswered

How do you set the "Items per page"?

1/14/2008 11:00 AM EST

I'm trying to modify our "Items per page" setting, but can't find it anywhere :(

We are using 4.1.2

1. 1/14/2008 1:59 PM EST

Do you mean the default number of records that are displayed in a paged table? Are you trying to set it globally or per paged table?

I don't see any itemsPerPage parameter in the tag descriptor for <dhv:pagedListStatus/>, but there may be an option to set it globally I'll have to check back with you.

2. 1/14/2008 9:01 PM EST

I didn't see any support for a global parameter either. If you were only doing this for one jsp you could put in a scriplet to replace the default of 10 with your own. Like the following example where the default (10) is replaced with 50:

<%
PagedListInfo pagedListInfo =
(PagedListInfo) pageContext.getSession().getAttribute("SalesDashboardListInfo");
if(pagedListInfo != null && pagedListInfo.getItemsPerPage() == PagedListInfo.DEFAULT_ITEMS_PER_PAGE)
pagedListInfo.setItemsPerPage(50);
pageContext.getSession().removeAttribute("SalesDashboardListInfo");
pageContext.getSession().setAttribute("SalesDashboardListInfo", pagedListInfo);
}
%>
<dhv:pagedListStatus title='<%= showError(request, "actionError") %>' object="SalesDashboardListInfo"/>

The user can still override with their own selection from the dropdown since that gets checked inside the <dhv:pagedListStatus /> taglib

3. 4/26/2009 5:08 PM EDT

Try DEFAULT_ITEMS_PER_PAGE in the PagedListInfo class... I didn't check it!

4. 7/16/2009 9:43 PM EDT

Ok, I've set this up to show all (-1) but it only actually shows all when the page is reloaded, not on the initial load.

By dumping out some info, I can see that the first load is still the default 10.

Here is the code I'm using:

<%
PagedListInfo pagedListInfo = (PagedListInfo) request.getSession().getAttribute("productCatalogListInfo");
if (pagedListInfo != null)

pagedListInfo.setItemsPerPage(-1);
pageContext.getSession().removeAttribute("productCatalogListInfo");
pageContext.getSession().setAttribute("productCatalogListInfo", pagedListInfo);
}
%>

I've tried different ways of getting the session, and they all act the same.

Any help would be most appreciated!

5. 7/16/2009 11:17 PM EDT
Default user photo

By Matt Rajkowski

Concursive Corporation
Product Design

airplane-icon-100x100.png

Couple of thoughts:
1) The server action initially controls the pagedListInfo and performs the query -- before the JSP code renders it... so, the best would be to update the server action and change the parameters of the pagedListInfo there

2) If updating the .java file isn't what you want to do, then you could put the JSP code in another file that loads before the page in question is rendered. That might work.

6. 7/18/2009 7:13 PM EDT

Good call and info, I'll check that out.

Thanks :)

6 results found