Dashboard > People > codesmell > 2008 > Juni > 13 > AnchoredBookmarkablePageLink
  codesmell Log In   View a printable version of the current page.  
  AnchoredBookmarkablePageLink
Added by Uwe Schaefer, last edited by Uwe Schaefer on Jun 13, 2008
Labels: 

Another Wicket Gem. Obvious but helpful.

import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.model.IModel;

/**
*  @author Thijs Vonk
**/
public class AnchoredBookmarkablePageLink extends BookmarkablePageLink {

 private static final long serialVersionUID = 1L;

 private IModel stringAnchor;

 public AnchoredBookmarkablePageLink(String id, Class pageClass, IModel anchor) {
   super(id, pageClass);
   this.stringAnchor = anchor;
 }

 public AnchoredBookmarkablePageLink(String id, Class pageClass, PageParameters params, IModel anchor) {
   super(id, pageClass, params);
   this.stringAnchor = anchor;
 }

 @Override
 protected CharSequence appendAnchor(ComponentTag tag, CharSequence url) {
   url = url + "#" + stringAnchor.getObject().toString();
   return url;
 }
 
}
Juni 2008
Sun Mon Tue Wed Thu Fri Sat
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          

Another Richtext-editor in Wicket called NicEdit
Ever heard of asynchronous Exceptions?

This site is powered by a free Atlassian Confluence Personal Server License. Evaluate Confluence for your organisation or read more about Confluence licensing here.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators