Hi Sam,
 
           Thank you for your help. I tried your exemple, but the request is still send :
 

<a href="" jwcid="[EMAIL PROTECTED]:AjaxLinkSubmit" updateComponents="ognl:{'batchSection'}" action="" effects="template:{highlight:{batchSection:'[255,255,184], 0, 500'}}">
 <span key="create">Create</span>
</a>


<script type="text/_javascript_">

 dojo.event.connect(dojo.byId("createTransactionBatch"), "onclick", function(e) {

  var value = confirm('message');

  alert(value);

  if (!value){
   e.preventDefault();

  }

 });
</script>

I have no doubt it works with usual HTML code, but I'm trying to make it works with Tacos.
 
Thanks
 
Charles-Andre Martin

 
On 6/3/06, Sam Gendler <[EMAIL PROTECTED]> wrote:
OK, I finally broke down and tested it and this code most definitely works:

<a href="" href="http://www.microsoft.com/"> http://www.microsoft.com/" id="confirm" >Click Me</a>
<script type="text/_javascript_">
   dojo.event.connect(dojo.byId("confirm"), "onclick", function(e) {
       var value = confirm('message');
       alert(value);
       if (!value) {
           e.preventDefault();
       }
   });
</script>


On 6/2/06, Sam Gendler < [EMAIL PROTECTED]> wrote:
> 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="" >> > "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'). {
> > > > > > >    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]
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > 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



--
Charles-André Martin
[EMAIL PROTECTED]
_______________________________________________
Tacos-devel mailing list
Tacos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to