On Wed, May 29, 2013 at 4:22 PM, Sven Meier <s...@meiers.net> wrote: > Hi Marcel, > > it seems #stopImmediatePropagation() does not work in jQuery when called > from an inline event handler: > > http://jsfiddle.net/2YUne/ > > jQuery marks the event as stopped immediately only, without delegating > this information to the original event (jQuery.js): > > stopImmediatePropagation: function() { > this.**isImmediatePropagationStopped = returnTrue; > this.stopPropagation(); > }, > > jQuery creates a new event object for dispatching to the registered > (non-inline) event handlers. Since this one doesn't have > isImmediatePropagationStopped returning true, further processing still > happens. >
This is a strange behavior in jQuery IMO. We should research why they do it this way. We can call jqEvent.originalEvent.stopImmediatePropagation() and its IE version in Wicket.Event.stop(). > > Sven > > > > On 05/29/2013 10:42 AM, Marcel Hoerr wrote: > >> Hi Martin >> >> i am afraid this does not do the trick. The AjaxLink still gets fired. >> >> Best regards >> >> marcel >> >> Gesendet: Mittwoch, 29. Mai 2013 um 10:12 Uhr >>> Von: "Martin Grigorov" <mgrigo...@apache.org> >>> An: "users@wicket.apache.org" <users@wicket.apache.org> >>> Betreff: Re: Re: Re: Re: wicket 6 and a confirm dialog >>> >>> Hi, >>> >>> Replace >>> "if (!conf) return false; "; >>> with >>> "if (!conf) { Wicket.Event.stop(event, true); return false;} "; >>> >>> in JavascriptEventConfirmation.**java >>> >>> >>> On Wed, May 29, 2013 at 11:07 AM, Marcel Hoerr <marcel.ho...@gmx.de> >>> wrote: >>> >>> Hi Martin, >>>> >>>> i created a simple quickstart (wicket 6) with a Link and an AjaxLink. I >>>> used the same Behavior as mentioned in the Wiki ( >>>> https://cwiki.apache.org/**WICKET/getting-user-**confirmation.html<https://cwiki.apache.org/WICKET/getting-user-confirmation.html>). >>>> The >>>> AjaxLink however get's fired in both cases: click on "ok" or "cancel". >>>> If i >>>> understood you correctly, this should work in wicket 6 too ("cancel" >>>> fires >>>> no request). >>>> >>>> Best regards >>>> >>>> marcel >>>> >>>> Gesendet: Dienstag, 28. Mai 2013 um 12:58 Uhr >>>>> Von: "Martin Grigorov" <mgrigo...@apache.org> >>>>> An: "users@wicket.apache.org" <users@wicket.apache.org> >>>>> Betreff: Re: Re: Re: wicket 6 and a confirm dialog >>>>> >>>>> On Tue, May 28, 2013 at 1:54 PM, Marcel Hoerr <marcel.ho...@gmx.de> >>>>> >>>> wrote: >>>> >>>>> Hi Martin, >>>>>> >>>>>> yeah you're right, the onclick solution still works for non-Ajax >>>>>> links. >>>>>> This should be mentionend in the wiki too, i was irritated about the >>>>>> "earlier wicket versions" paragraph. >>>>>> >>>>>> The WIKI is editable by everyone. >>>>> Please improve it for the next readers. >>>>> Thanks! >>>>> >>>>> >>>>> But the onclick solution with a Behavior (or AttributeModifier) is not >>>>>> working for our Ajax Components anymore. I will give it a try in a >>>>>> Quickstart, if you say it should work. >>>>>> >>>>>> Best regards >>>>>> >>>>>> marcel >>>>>> >>>>>> Gesendet: Montag, 27. Mai 2013 um 14:46 Uhr >>>>>>> Von: "Martin Grigorov" <mgrigo...@apache.org> >>>>>>> An: "users@wicket.apache.org" <users@wicket.apache.org> >>>>>>> Betreff: Re: Re: wicket 6 and a confirm dialog >>>>>>> >>>>>>> Hi Marcel, >>>>>>> >>>>>>> But the solution with onclick attribute is still valid for non-Ajax >>>>>>> >>>>>> link. >>>> >>>>> You can use it for Ajax link too - returning false will stop the >>>>>>> >>>>>> execution >>>>>> >>>>>>> of the bound event listener used by Wicket to do its work. >>>>>>> >>>>>>> >>>>>>> On Mon, May 27, 2013 at 2:02 PM, <marcel.ho...@gmx.de> wrote: >>>>>>> >>>>>>> Hi Martin, >>>>>>>> >>>>>>>> the suggested solution needs AjaxRequestAttributes in order to >>>>>>>> >>>>>>> display >>>> >>>>> the >>>>>> >>>>>>> confirm dialog. In an non Ajax setting there would be no >>>>>>>> >>>>>>> ajaxrequest >>>> >>>>> though. >>>>>> >>>>>>> Best regards >>>>>>>> >>>>>>>> marcel >>>>>>>> >>>>>>>> Am 27.05.13 um 11:37 schrieb Martin Grigorov >>>>>>>>> >>>>>>>>> Hi Marcel, >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> What exactly is the issue with non-Ajax links ? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Mon, May 27, 2013 at 12:34 PM, Marcel Hoerr < >>>>>>>>>> >>>>>>>>> marcel.ho...@gmx.de> >>>>>> >>>>>>> wrote: >>>>>>>> >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Hi wicket community, >>>>>>>>>>> i have a question about how to implement a confirm dialog via >>>>>>>>>>> >>>>>>>>>> javascript >>>>>>>> >>>>>>>>> on a button or link. Before wicket 6 we used a simple >>>>>>>>>>> >>>>>>>>>> behavior >>>> >>>>> (as >>>>>> >>>>>>> mentioned here: >>>>>>>>>>> >>>>>>>>>> https://cwiki.apache.org/**WICKET/getting-user-** >>>> confirmation.html<https://cwiki.apache.org/WICKET/getting-user-confirmation.html> >>>> ) >>>> >>>>> which >>>>>>>> >>>>>>>>> could be used to enrich any button or link (ajaxified or >>>>>>>>>>> >>>>>>>>>> not) at >>>> >>>>> any >>>>>> >>>>>>> time. >>>>>>>> >>>>>>>>> With wicket 6 this solution is not working anymore.The >>>>>>>>>>> >>>>>>>>>> suggested >>>> >>>>> (javascript) solution on >>>>>>>>>>> >>>>>>>>>> https://cwiki.apache.org/**WICKET/getting-user-** >>>> confirmation.html[https://**cwiki.apache.org/WICKET/** >>>> getting-user-confirmation.**html]hastwodownsides(from<https://cwiki.apache.org/WICKET/getting-user-confirmation.html%5Bhttps://cwiki.apache.org/WICKET/getting-user-confirmation.html%5Dhastwodownsides(from>my >>>> perspective): >>>> >>>>> - It requires an ajax component (button or link). >>>>>>>>>>> - It extends a component. As we use different basic >>>>>>>>>>> >>>>>>>>>> components >>>> >>>>> (which use >>>>>>>> >>>>>>>>> buttons or links -- not always their ajax companions), we >>>>>>>>>>> >>>>>>>>>> would >>>> >>>>> have >>>>>> >>>>>>> to >>>>>>>> >>>>>>>>> extends all these basic components to be able use a confirm >>>>>>>>>>> >>>>>>>>>> dialog >>>>>> >>>>>>> on them >>>>>>>> >>>>>>>>> for certain use cases. >>>>>>>>>>> Are there any other suggestions out there or is the suggested >>>>>>>>>>> >>>>>>>>>> solution >>>>>>>> >>>>>>>>> mentioned above the new "wicket way" to achieve a confirm >>>>>>>>>>> >>>>>>>>>> dialog? >>>> >>>>> Best regards >>>>>>>>>>> marcel >>>>>>>>>>> >>>>>>>>>> ------------------------------**------------------------------** >>>>>> --------- >>>>>> >>>>>>> To unsubscribe, e-mail: >>>>>>> users-unsubscribe@wicket.**apache.org<users-unsubscr...@wicket.apache.org> >>>>>>>>>>> For additional commands, e-mail: >>>>>>>>>>> >>>>>>>>>> users-h...@wicket.apache.org >>>> >>>>> >>>>>>>> ------------------------------**------------------------------** >>>> --------- >>>> >>>>> To unsubscribe, e-mail: >>>>> users-unsubscribe@wicket.**apache.org<users-unsubscr...@wicket.apache.org> >>>>>>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>>>>>> >>>>>>>> >>>>>>>> ------------------------------**------------------------------** >>>>>> --------- >>>>>> To unsubscribe, e-mail: >>>>>> users-unsubscribe@wicket.**apache.org<users-unsubscr...@wicket.apache.org> >>>>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>>>> >>>>>> >>>>>> >>>> ------------------------------**------------------------------** >>>> --------- >>>> To unsubscribe, e-mail: >>>> users-unsubscribe@wicket.**apache.org<users-unsubscr...@wicket.apache.org> >>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>> >>>> > >> >> >> ------------------------------**------------------------------**--------- >> To unsubscribe, e-mail: >> users-unsubscribe@wicket.**apache.org<users-unsubscr...@wicket.apache.org> >> For additional commands, e-mail: users-h...@wicket.apache.org >> > >