Hi, Are you saying that the event of clicking the bookmarkable link (the <a>) bubbles to the <div> ? I think it should not happen. Clicking the link changes the document location... But I may be wrong.
A simple solution is to add onclick="Wicket.Event.stop(event); return true;" to the <a> element. This calls event.stopPropagation(). On Wed, Apr 24, 2013 at 10:03 AM, Per Newgro <[email protected]> wrote: > Hi, > > i would like to add a bookmarkable page link to a clickable div. > But the event behavior of the div is always executed. Is there a > way to prioritize the event coming from the link? > > Thanks > Per > > <code> > Page.java > public class Page extends WebPage { > public Page(final PageParameters parameters) { > super(parameters); > > final Label marker; > add(marker = new Label("marker", new Model<String>())); > marker.setOutputMarkupId(true); > > WebMarkupContainer outer; > add(outer = (WebMarkupContainer) new > WebMarkupContainer("outer").add(new AjaxEventBehavior("onclick") { > > @Override > protected void onEvent(AjaxRequestTarget target) { > marker.setDefaultModelObject("outer at " + > System.currentTimeMillis()); > target.add(marker); > } > })); > > BookmarkablePageLink<Void> inner; > outer.add(inner = new BookmarkablePageLink<Void>("inner", > OtherPage.class)); > } > } > > Page.html > <div> > <span wicket:id="marker">Present the event</span> > <div wicket:id="outer"> > <a wicket:id="inner">Click</a> > </div> > </div> > </code> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com <http://jweekend.com/>
