Nothing separates the generations more than music. By the time a child is eight or nine,he has developed a passion for his own music that is even stronger than his passions for procrastination and weird clothes.
-Bill Cosby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | <% // Get parameters int start = ParamUtils.getIntParameter(request,"start",0); int range = ParamUtils.getIntParameter(request,"range",webManager.getRowsPerPage("group-summary", 15)); if (request.getParameter("range") != null) { webManager.setRowsPerPage("group-summary", range); } int groupCount = webManager.getGroupManager().getGroupCount(); Collection<Group> groups = webManager.getGroupManager().getGroups(start, range); String search = null; if (webManager.getGroupManager().isSearchSupported() && request.getParameter("search") != null && !request.getParameter("search").trim().equals("")) { search = request.getParameter("search"); // Use the search terms to get the list of groups and group count. groups = webManager.getGroupManager().search(search, start, range); // Get the count as a search for *all* groups. That will let us do pagination even // though it's a bummer to execute the search twice. groupCount = webManager.getGroupManager().search(search).size(); } // paginator vars int numPages = (int)Math.ceil((double)groupCount/(double)range); int curPage = (start/range) + 1; %> <% if (request.getParameter("deletesuccess") != null) { %> <div class="jive-success"> <table cellpadding="0" cellspacing="0" border="0"> <tbody> <tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0" alt=""></td> <td class="jive-icon-label"> <fmt:message key="group.summary.delete_group" /> </td></tr> </tbody> </table> </div><br> <% } %> <% if (webManager.getGroupManager().isSearchSupported()) { %> <form action="group-summary.jsp" method="get" name="searchForm"> <table border="0" width="100%" cellpadding="0" cellspacing="0"> <tr> <td valign="bottom"> <fmt:message key="group.summary.total_group" /> <b><%= groupCount %></b> <% if (numPages > 1) { %> , <fmt:message key="global.showing" /> <%= LocaleUtils.getLocalizedNumber(start+1) %>-<%= LocaleUtils.getLocalizedNumberstartrange > groupCount ? groupCount:start+range) %> <% } %> </td> <td align="right" valign="bottom"> <fmt:message key="group.summary.search" />: <input type="text" size="30" maxlength="150" name="search" value="<%= ((search!=null) ? search : "") %>"> </td> </tr> </table> </form> <script language="JavaScript" type="text/javascript"> document.searchForm.search.focus(); </script> <% } // Otherwise, searching is not supported. else { %> <p> <fmt:message key="group.summary.total_group" /> <b><%= groupCount %></b> <% if (numPages > 1) { %> , <fmt:message key="global.showing" /> <%= (start+1) %>-<%= (start+range) %> <% } %> </p> <% } %> <% if (numPages > 1) { %> <p> <fmt:message key="global.pages" /> [ <% for (int i=0; i<numPages; i++) { String sep = ((i+1)<numPages) ? " " : ""; boolean isCurrent = (i+1) == curPage; %> <a href="group-summary.jsp?start=<%= (i*range) %><%= search!=null? "&search=" + URLEncoder.encode(search, "UTF-8") : ""%>" class="<%= ((isCurrent) ? "jive-current" : "") %>" ><%= (i+1) %></a><%= sep %> <% } %> ] </p> |
If you enjoyed this post,make sure you subscribe to my RSS feed!



[...] Weird Clothes [...]