Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 1st, 2012  |  syntax: None  |  size: 2.54 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do I modify the markup generated by a Wicket link in a PagingNavigator?
  2. <wicket:panel>
  3. <ul class="pagination">
  4.     <li class="first">
  5.         <a wicket:id="first"><<</a>
  6.     </li>
  7.     <li class="prev">
  8.         <a wicket:id="prev">&#060;</a>
  9.     </li>
  10.     <li wicket:id="navigation" class="page">
  11.         <a wicket:id="pageLink" href="#">
  12.             <span wicket:id="pageNumber">5</span>
  13.         </a>
  14.     </li>
  15.     <li class="dots">...</li>
  16.     <li wicket:id="lastPage" class="jump"></li>
  17.     <li class="next">
  18.         <a wicket:id="next">&#062;</a>
  19.     </li>
  20.     <li class="last">
  21.         <a wicket:id="last">>></a>    
  22.     </li>
  23. </ul>
  24.        
  25. <span title="Item Title" id="RandomID">
  26.     <em>
  27.       <span>ItemText</span>
  28.     </em>
  29. </span>
  30.        
  31. <a href="#" title=ItemTitle" id="RandomID" class="inactive">ItemText</a>
  32.        
  33. <a href="#" title=ItemTitle" id="RandomID" class="currentPage">ItemText</a>
  34.        
  35. import org.apache.wicket.markup.html.navigation.paging.IPageable;
  36. import org.apache.wicket.markup.html.navigation.paging.IPagingLabelProvider;
  37. import org.apache.wicket.markup.html.navigation.paging.PagingNavigator;
  38.  
  39. class MyPagingNavigator extends PagingNavigator {
  40.  
  41.     public MyPagingNavigator(String id, IPageable pageable) {
  42.         super(id, pageable);
  43.     }
  44.  
  45.     public MyPagingNavigator(String id, IPageable pageable, IPagingLabelProvider labelProvider) {
  46.         super(id, pageable, labelProvider);
  47.     }
  48.  
  49.  
  50.  
  51. }
  52.        
  53. <?xml version="1.0" encoding="UTF-8" ?>
  54. <!--
  55.    Licensed to the Apache Software Foundation (ASF) under one or more
  56.    contributor license agreements.  See the NOTICE file distributed with
  57.    this work for additional information regarding copyright ownership.
  58.    The ASF licenses this file to You under the Apache License, Version 2.0
  59.    (the "License"); you may not use this file except in compliance with
  60.    the License.  You may obtain a copy of the License at
  61.  
  62.         http://www.apache.org/licenses/LICENSE-2.0
  63.  
  64.    Unless required by applicable law or agreed to in writing, software
  65.    distributed under the License is distributed on an "AS IS" BASIS,
  66.    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  67.    See the License for the specific language governing permissions and
  68.    limitations under the License.
  69. -->
  70. <html xmlns:wicket>
  71. <body>
  72.   <wicket:panel>
  73.     <a wicket:id="first"><<</a>&nbsp;<a wicket:id="prev"><</a>
  74.     <span wicket:id="navigation">
  75.           <a wicket:id="pageLink" href="#"><span wicket:id="pageNumber">5</span></a>
  76.     </span>
  77.     <a wicket:id="next">></a>&nbsp;<a wicket:id="last">>></a>
  78.   </wicket:panel>
  79. </body>
  80. </html>