I've used the very code that Jesse provided with no issues (although I used preventDefault() instead of stopEvent(e). You did remove your code from the onclick handler directly in the <a> tag, didn't you?
--sam On 6/2/06, Charles-André Martin <[EMAIL PROTECTED]> wrote: > > > Thanks for the help, I tried it with IE and the request is still > send. I don't have any more idea how it could work. My only chance is to > invoke a AjaxEventSubmit javascript function. > > This is a strange problem, as if nobody ever wanted to display a > confirm message ! > Maybe I could use the dojo Dialog... > > > Thanks for the help ! > > Charles-Andre Martin > > > On 6/1/06, Jesse Kuhnert <[EMAIL PROTECTED]> wrote: > > > > Oh ....That's because there is no event to stop when you embed it directly > in the tag like that :) > > > > A better approach would be to add a <script> tag somewhere in your > document (or use the @Script component to manage the js for you ) > > > > <script type="text/javascript" > > > dojo.event.connect(dojo.byId("create"), "onclick", function(e){ > > dojo.event.browser.stopEvent(e); > > // now do whatever it is you want to do > > }); > > </script> > > > > > > > > On 6/1/06, Charles-André Martin <[EMAIL PROTECTED] > wrote: > > > > > > > > > Thanks Jesse for the answer. Sadly, It doesn't work. Did you tried it ? > I mean, maybe the problem is my code : > > > > > > > > > <a href="#" jwcid ="[EMAIL PROTECTED]:AjaxLinkSubmit" > updateComponents="ognl:{'batchSection'}" action="listener:create" onclick= > "if (!confirm('message')){dojo.event.browser.stopEvent(event); }"> > > > > > > I have tested it on IE and firefox, the request is still send when the > user click cancel. > > > > > > Another way I could use to display a confirm message is to use an > AjaxEventSubmit. This is true only if I could invoke the generated > javascript function. To do so, I must have a way to get the function name. > Do you know how I could have it ? > > > > > > Thanks ! > > > > > > Charles-Andre Martin > > > > > > > > > > > > On 5/31/06, Jesse Kuhnert <[EMAIL PROTECTED] > wrote: > > > > > > > > An easier method is to use dojo.event.browser.stopEvent(e) to call > both event methods. (preventDefault && stopPropogation) > > > > > > > > > > > > > > > > On 5/31/06, Charles-André Martin <[EMAIL PROTECTED] > > wrote: > > > > > > > > > > > > > > > Hi Andreas, > > > > > > > > > > Both approch still send the event to the server ! > Invoking the preventDefault() is the same as returning false. Could this be > a bug ? > > > > > > > > > > Charles-Andre > > > > > > > > > > > > > > > > > > > > On 5/31/06, Andreas Andreou <[EMAIL PROTECTED] > wrote: > > > > > > Google for the preventDefault method of a javascript event. > > > > > > > > > > > > For instance, assuming > > > > > > > > > > > > <a jwcid=" [EMAIL PROTECTED]:AjaxLinkSubmit" > > > > > > updateComponents="ognl:{'tableSection'}" > > > > > > listener="listener:search"><span > key="search">Search</span></a> > > > > > > > > > > > > add > > > > > > document.getElementById ('search').onclick= function(e) { > > > > > > if (!confirm('message')) e.preventDefault(); > > > > > > } > > > > > > > > > > > > or > > > > > > > > > > > > dojo.event.connect(dojo.byId('search'), "onclick", function(e) { > > > > > > if (!confirm('message')) e.preventDefault (); > > > > > > }); > > > > > > > > > > > > > > > > > > > > > > > > Martin, Charles-Andre wrote: > > > > > > > Hi, > > > > > > > > > > > > > > First, I would like to say thanks for all the jobs you've > done. > > > > > > > Tacos is a great framework ! Nevertheless, I need help with a > confirm > > > > > > > message problem. > > > > > > > > > > > > > > I would like to display a javascript confirm message when the > user > > > > > > > click on a link. If the user click OK, then I would like to send > an > > > > > > > AJAX event to the server. If the user click on the cancel > button, I > > > > > > > would like to stay on the page. I've read and tried the Are You > Sure ? > > > > > > > example in the EnjoyWebDevWithTapestry.pdf book, but it doens't > work. > > > > > > > Indeed, when I register my confirm function with dojo on the > onclick > > > > > > > event, it still send the request when the user click on the > cancel button. > > > > > > > > > > > > > > I also tried to use an AjaxEventSubmit component. But, I can't > get the > > > > > > > generated javascript function name using the > > > > > > > AjaxEventSubmit.getFunctionName() method. > > > > > > > > > > > > > > Futhermore, I tried this : > > > > > > > > > > > > > > <a jwcid="[EMAIL PROTECTED]:AjaxLinkSubmit" > > > > > > > updateComponents="ognl:{'tableSection'}" > listener="listener:search" > > > > > > > href="#" class="aRedFilter" onclick="return > > > > > > > confirm('message:deleteMessage');"><span > > > > > > > key="search">Search</span></a></td> > > > > > > > > > > > > > > But the request is send if the user click on the ok and the > cancel button > > > > > > > > > > > > > > Although I've read some people faced the same problem on the > mailing > > > > > > > list, I couldn't find a solution. > > > > > > > > > > > > > > Thanks for the help ! > > > > > > > > > > > > > > Charles-Andre Martin > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > "Ce message est confidentiel, a l'usage exclusif du destinataire > > > > > > > ci-dessus et son contenu ne represente en aucun cas un > engagement de > > > > > > > la part de AXA, sauf en cas de stipulation expresse et par ecrit > de la > > > > > > > part de AXA. Toute publication, utilisation ou diffusion, meme > > > > > > > partielle, doit etre autorisee prealablement. Si vous n'etes pas > > > > > > > destinataire de ce message, merci d'en avertir immediatement > > > > > > > l'expediteur." > > > > > > > > > > > > > > "This e-mail message is confidential, for the exclusive use of > the > > > > > > > addressee and its contents shall not constitute a commitment by > AXA, > > > > > > > except as otherwise specifically provided in writing by AXA. Any > > > > > > > unauthorized disclosure, use or dissemination, either whole or > > > > > > > partial, is prohibited. If you are not the intended recipient of > the > > > > > > > message, please notify the sender immediately." > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > > All the advantages of Linux Managed Hosting--Without the Cost and > Risk! > > > > > > Fully trained technicians. The highest number of Red Hat > certifications in > > > > > > the hosting industry. Fanatical Support. Click to learn more > > > > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 > > > > > > _______________________________________________ > > > > > > Tacos-devel mailing list > > > > > > Tacos-devel@lists.sourceforge.net > > > > > > > https://lists.sourceforge.net/lists/listinfo/tacos-devel > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Charles-André Martin > > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > -- > > > > Jesse Kuhnert > > > > Tacos/Tapestry, team member/developer > > > > > > > > Open source based consulting work centered around > dojo/tapestry/tacos/hivemind. > > > > > > > > > > > > > > > -- > > > > > > Charles-André Martin > > > [EMAIL PROTECTED] > > > > > > > > -- > > Jesse Kuhnert > > Tacos/Tapestry, team member/developer > > > > Open source based consulting work centered around > dojo/tapestry/tacos/hivemind. > > > > -- > > Charles-André Martin > [EMAIL PROTECTED] > > > _______________________________________________ > Tacos-devel mailing list > Tacos-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/tacos-devel > > > _______________________________________________ Tacos-devel mailing list Tacos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tacos-devel