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'). {
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" >> 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]