List of usage examples for org.apache.wicket.ajax.markup.html.navigation.paging AjaxPagingNavigationLink AjaxPagingNavigationLink
public AjaxPagingNavigationLink(final String id, final IPageable pageable, final long pageNumber)
From source file:au.org.theark.core.web.component.navigator.ArkAjaxPagingNavigator.java
License:Open Source License
@Override protected Link<?> newPagingNavigationLink(String id, IPageable pageable, int pageNumber) { AjaxPagingNavigationLink link = new AjaxPagingNavigationLink(id, pageable, pageNumber) { private static final long serialVersionUID = 1L; @Override//from www . j ava 2s . c o m protected void onInitialize() { super.onInitialize(); add(new AjaxPagingNavigationBehavior(this, pageable, "onclick") { private static final long serialVersionUID = 1L; @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); String onClickEvent = tag.getAttribute("onclick"); if (onClickEvent != null) { tag.put("onclick", dirtyFormJavaScript(onClickEvent)); } } }); } }; return link; }
From source file:au.org.theark.core.web.component.navigator.ArkAjaxPagingNavigator.java
License:Open Source License
@Override protected PagingNavigation newNavigation(String id, IPageable pageable, IPagingLabelProvider labelProvider) { return new AjaxPagingNavigation("navigation", pageable, labelProvider) { private static final long serialVersionUID = 1456846335814294449L; protected PagingNavigationLink<?> newPagingNavigationLink(String id, IPageable pageable, int pageIndex) { AjaxPagingNavigationLink link = new AjaxPagingNavigationLink(id, pageable, pageIndex) { private static final long serialVersionUID = 1L; @Override//w ww. j av a2 s . c o m protected void onInitialize() { super.onInitialize(); add(new AjaxPagingNavigationBehavior(this, pageable, "onclick") { /** * */ private static final long serialVersionUID = 1L; @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); String onClickEvent = tag.getAttribute("onclick"); if (onClickEvent != null) { tag.put("onclick", dirtyFormJavaScript(onClickEvent)); } } }); } }; return link; } }; }
From source file:com.norconex.commons.wicket.bootstrap.table.BootstrapAjaxPagingNavigator.java
License:Apache License
@Override protected AbstractLink newPagingNavigationLink(final String id, IPageable pageable, int pageNumber) { final AjaxPagingNavigationLink link = new AjaxPagingNavigationLink(id, pageable, pageNumber) { private static final long serialVersionUID = -4537725137974552570L; protected long cullPageNumber(long pageNumber) { long idx = pageNumber; if (id.startsWith("first")) { return 0; }/*w w w .j a v a 2 s. c o m*/ if (id.startsWith("last")) { return pageable.getPageCount() - 1; } if (id.startsWith("prev")) { idx = pageable.getCurrentPage() - 1; } else if (id.startsWith("next")) { idx = pageable.getCurrentPage() + 1; } if (idx < 0) { idx = 0; } if (idx > (pageable.getPageCount() - 1)) { idx = pageable.getPageCount() - 1; } if (idx < 0) { idx = 0; } return idx; } }; AjaxLink<String> navCont = new AjaxLink<String>(id + "Cont") { private static final long serialVersionUID = -7566811745303329592L; @Override public void onClick(AjaxRequestTarget target) { link.onClick(target); } }; navCont.add(link); // add css for enable/disable link long pageIndex = pageable.getCurrentPage() + pageNumber; navCont.add(new AttributeModifier("class", new BootstrapPageLinkCssModel(pageable, pageIndex, "disabled"))); return navCont; }
From source file:com.norconex.commons.wicket.bootstrap.table.BootstrapAjaxPagingNavigator.java
License:Apache License
@Override protected AbstractLink newPagingNavigationIncrementLink(final String id, IPageable pageable, int increment) { final AjaxPagingNavigationLink link = new AjaxPagingNavigationLink(id, pageable, increment) { private static final long serialVersionUID = 6737074324471003133L; protected long cullPageNumber(long pageNumber) { long idx = pageNumber; if (id.startsWith("first")) { return 0; }// w ww. j a va2s .c o m if (id.startsWith("last")) { return pageable.getPageCount() - 1; } if (id.startsWith("prev")) { idx = pageable.getCurrentPage() - 1; } else if (id.startsWith("next")) { idx = pageable.getCurrentPage() + 1; } if (idx < 0) { idx = 0; } if (idx > (pageable.getPageCount() - 1)) { idx = pageable.getPageCount() - 1; } if (idx < 0) { idx = 0; } return idx; } }; AjaxLink<String> navCont = new AjaxLink<String>(id + "Cont") { private static final long serialVersionUID = -7414576817418282720L; @Override public void onClick(AjaxRequestTarget target) { link.onClick(target); } }; navCont.add(link); // add css for enable/disable link long pageIndex = pageable.getCurrentPage() + increment; navCont.add(new AttributeModifier("class", new BootstrapPageLinkIncrementCssModel(pageable, pageIndex))); return navCont; }
From source file:com.schat.components.paging.bootstrap.BootstrapPagingNavigator.java
License:Apache License
@Override protected AbstractLink newPagingNavigationLink(String id, IPageable pageable, int pageNumber) { ExternalLink navCont = new ExternalLink(id + "Cont", (String) null); // add css for enable/disable link long pageIndex = pageable.getCurrentPage() + pageNumber; //navCont.add(new AttributeModifier("class", new PagingNavigationLinkCssModel(pageable, pageIndex, "disabled"))); // change original wicket-link, so that it always generates href navCont.add(new AjaxPagingNavigationLink(id, pageable, pageNumber) { @Override//from w w w.ja va 2 s .co m protected void disableLink(ComponentTag tag) { } }); return navCont; }
From source file:org.cyclop.web.components.pagination.BootstrapPagingNavigator.java
License:Apache License
@Override protected AbstractLink newPagingNavigationLink(String id, IPageable pageable, int pageNumber) { ExternalLink navCont = new ExternalLink(id + "Cont", (String) null); // add css for enable/disable link long pageIndex = pageable.getCurrentPage() + pageNumber; navCont.add(/*from w w w .jav a2 s . co m*/ new AttributeModifier("class", new PagingNavigationLinkCssModel(pageable, pageIndex, "disabled"))); // change original wicket-link, so that it always generates href navCont.add(new AjaxPagingNavigationLink(id, pageable, pageNumber) { @Override protected void disableLink(ComponentTag tag) { } }); return navCont; }
From source file:org.hippoecm.frontend.plugins.standards.list.datatable.ListPagingNavigation.java
License:Apache License
@Override protected Link newPagingNavigationLink(String id, IPageable pageable, long pageIndex) { return new AjaxPagingNavigationLink(id, pageable, pageIndex); }
From source file:org.sakaiproject.sitestats.tool.wicket.components.SakaiPagingNavigator.java
License:Educational Community License
/** * Create a new pagenumber link. May be subclassed to make use of specialized links, e.g. * Ajaxian links.//from w ww. j a v a 2 s . co m * * @param id * the link id * @param pageable * the pageable to control * @param pageNumber * the page to jump to * @return the pagenumber link */ protected Link newPagingNavigationLink(String id, IPageable pageable, int pageNumber) { return new AjaxPagingNavigationLink(id, pageable, pageNumber); }