Hi,

You can override onComponentTag() of this AjaxLink and do tag.put("href",
redirectUrl);
In addition you need to stop the propagation of the JS event: override
#updateAjaxAttributes() and do attributes.setEventPropagation(STOP)
One more thing you may need here is a precondition that checks whether it
is a left or right click. For this you can use:
attributes.getAjaxCallListeners().add(new
AjaxCallListener().onPrecondition("someJavaScriptThatUses attrs.event to do
the extra checks"))

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Jul 26, 2016 at 7:51 PM, sorinev <sori...@gmail.com> wrote:

> I have an AjaxLink on my page.
>
>
>
> and the modal side of it is:
>
>
>
> And this works just fine. When I click the link, a wicket modal window
> opens
> with the content of that modal being loaded from an external url.
>
> However, a request has been made to change the functionality slightly. When
> left clicking, the behavior should remain as is, but when right clicking on
> the link and choosing open in a new tab or window, it should open a new
> tab/window with that external url instead of popping up the modal. I've
> googled around and haven't found a way to do this.
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Link-open-modal-on-left-click-new-tab-window-on-right-click-context-tp4675216.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to