Hi, I don't use a mouse (and I have no one around) so I cannot test the use case. I cannot see how org.apache.wicket.ajax.markup.html.form.AjaxButton#onSubmit(org.apache.wicket.ajax.AjaxRequestTarget, org.apache.wicket.markup.html.form.Form<?>) or org.apache.wicket.ajax.markup.html.AjaxLink#onClick(org.apache.wicket.ajax.AjaxRequestTarget) would deliver null as a target. The target is created at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#onRequest(). Put a breakpoint there is see what happens.
Martin Grigorov Freelancer, available for hire! Wicket Training and Consulting https://twitter.com/mtgrigorov On Wed, Mar 25, 2015 at 3:33 PM, Patrick Davids < [email protected]> wrote: > Hi all, > I have a problem here, I would like to ask you for feedback. > > I am not sure, if its more a jquery/js / wicket issue, so thanx in advance > for any brainstorming and hints. > > Browsers often features the middle mouse button to open a link or button > in a new tab. > This is quite browser-specific, so I'm looking for the most independent > solution. > > Clicking the middle mouse on a ajaxified Link or Button, the browser opens > a new tab and starts a usual request cycle. > > This leads into wicket call e.g. > onClick(AjaxRequestTarget target) > but then the target parameter is null. > (I cannot use AjaxFallbackLinks in my case) > > I'm able to handle this NPEs by implementing null-checks on every ajax > link. > Hmm... not the perfect solution. > > So, I could try to prevent middle mouse clicks by a global javascript on > all pages. > I've seen several scripts, and here also it seems to be very > browser-specific (mousewheel, or not... event.which seem to differ and > so...). > Also, not my favorite solution, yet. > > Then I thought about wicket solution. Is there any possible way? > I know about a IComponentOnConfigureListener, which can be used to have to > implement an application-wide onConfigure() for any component in page > hierarchy. > Is there something siilar e.g. IComponentOnAjaxRequestListener? > So I could implement some code there, checking for null and stop any > further code-calls on ajaxified wicket components, to avoid running into > NPEs in later code? > > All these are my thoughts for now. > > Thanx a lot for feedback... > > kind regards > Patrick > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
