zoukankan      html  css  js  c++  java
  • 【DRP】表格—分页查询(2)—翻页、显示页码

    翻页:

    前台代码:

     1              <div align="right">
     2                             <input name="btnTopPage" class="button1" type="button"
     3                                 id="btnTopPage" value="|&lt;&lt; " title="首页"
     4                                 onClick="topPage()">
     5                             <input name="btnPreviousPage" class="button1" type="button"
     6                                 id="btnPreviousPage" value=" &lt;  " title="上页"
     7                                 onClick="previousPage()">
     8                             <input name="btnNextPage" class="button1" type="button"
     9                                 id="btnNextPage" value="  &gt; " title="下页" onClick="nextPage()">
    10                             <input name="btnBottomPage" class="button1" type="button"
    11                                 id="btnBottomPage" value=" &gt;&gt;|" title="尾页"
    12                                 onClick="bottomPage()">
    13                     </div>

    js代码:

     1 //首页
     2     function topPage() {
     3         window.self.location = "user_maint.jsp?pageNo=<%=pageModel.getTopPageNo()%>";
     4     }
     5     //上一页
     6     function previousPage() {
     7         window.self.location = "user_maint.jsp?pageNo=<%=pageModel.getPreviousPageNo()%>";
     8     }    
     9     //下一页
    10     function nextPage() {
    11         window.self.location = "user_maint.jsp?pageNo=<%=pageModel.getNextPageNo()%>";
    12     }
    13     //尾页
    14     function bottomPage() {
    15         window.self.location = "user_maint.jsp?pageNo=<%=pageModel.getBottomPageNo()%>";
    16     }

    显示页码:

    前台代码:

    1                        <div align="left">
    2                             <font color="#FFFFFF">&nbsp;&nbsp;<%=pageModel.getTotalPages() %>&nbsp;</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    3                             <font color="#FFFFFF">当前第</font>&nbsp
    4                             <font color="#FF0000"><%=pageModel.getPageNo() %></font>&nbsp
    5                             <font color="#FFFFFF"></font>
    6                         </div>

    调用统一入口:

    1 PageModel pageModel = UserManager.getInstance().findUserList(pageNo, pageSize);    

    总结:不断提高自己编码效率!

  • 相关阅读:
    LockSupport的用法及原理
    ReentrantReadWriteLock读写锁详解
    Java的CountDownLatch和CyclicBarrier的理解和区别
    AbstractQueuedSynchronizer超详细原理解析
    走进JVM
    【题解】Hanoi塔问题
    【题解】二的幂次方
    【题解】桐桐的递归函数
    【题解】数的计数
    【题解】极品飞车
  • 原文地址:https://www.cnblogs.com/yinweitao/p/5623780.html
Copyright © 2011-2022 走看看