I can post the cvs link of my project , I've built some tapestry and tacos components, including this confirmation message over AjaxDirectLink comp..
All this when i go back home, and commit my changes.

ciao,
kiuma

On 1/11/06, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:
No way! Awesome ! :)

That is a very unintuitive way for this to happen though. Sorry you had to go through so much trouble, I'll see what I can do to fix that in the future. I do the same exact sort of things with forms and validation so I still don't understand why it didn't work but I'm happy it's working now :)




On 1/11/06, Andrea Chiumenti < [EMAIL PROTECTED]> wrote:
SOLVED!

Finally I tryed the around solution and it woks!

function confirmDelete() {
  return confirm("${msgConfirmDelete}");
}

var dialogMessage = {
  confirm : function (invocation) {
    var result = false;
    if (confirmDelete()) {
      result = invocation.proceed();
    }
    return result;
};

dojo.event.connect(
  "around",
  dojo.byId('${elementId}'),
  "onclick",
  dialogMessage,
  "confirm"
);

On 1/11/06, Andrea Chiumenti < [EMAIL PROTECTED]> wrote:
ok, after having enbled debug, only DEBUG: messages are shouwn, no error.


On 1/11/06, Jesse Kuhnert < [EMAIL PROTECTED] > wrote:
what about changing it to window instead?

Hmmm........Do you have debug console enabled? Try changing the param to window instead and also enable the debug console to see if any errors/other weird stuff is happening. There has to be a reasonable explanation for this.

It does look like your function is being called first though? Maybe the debug console will reveal an error not found before.


On 1/11/06, Andrea Chiumenti <[EMAIL PROTECTED]> wrote:
in the form :

dojo.event.connect(
  "before",
  dojo.byId('${elementId}'),
  "onclick",
  document,
  "confirm"
);

the only result is that no confirmation message is shown (I think ff doesn't consider confirm a document function.
Anyway adding event.preventDefault(); in my previous code doesn't change things.

I wonder if the only hope is to use an around function...


On 1/11/06, Jesse Kuhnert <[EMAIL PROTECTED] > wrote:
What happens if you  change your code to this instead (exactly) :

function confirm(event) {
  if (!confirmDelete()) {
     event.stopPropogation();
     event.preventDefault();
  }
}

dojo.event.connect(
  "before",
  dojo.byId('${elementId}'),
  "onclick",
  document,
  "confirm"
);

?
jesse


On 1/11/06, Andrea Chiumenti < [EMAIL PROTECTED]> wrote:
Hi again,
I've changed the script but the ajax script is executed anyway.

function confirmDelete() {
  return confirm("${msgConfirmDelete}");
}

var dialogMessage = {
  confirm : function (e) {
    if (!confirmDelete()) {
      e.stopPropagation();
      return false;
    }
};

dojo.event.connect(
  "before",
  dojo.byId('${elementId}'),
  "onclick",
  dialogMessage,
  "confirm"
);

On cancel the ajax script on the link is executed anyway.

Could you help me please?
kiuma

On 1/10/06, Andreas Andreou < [EMAIL PROTECTED]> wrote:


Leonardo Quijano Vincenzi wrote:

> Hmmm right, I get it. I was only wondering if the code snippet would
> get documented. I guess I can do it later too ;).

Didn't have time to create a FAQ for it.
I just copy-pasted the jesse's code in a bug comment.
http://tacoscomponents.jot.com/BugReporter/Bug26
If noone does it by tomorrow, i'll do it then :)

>
> (that's the sort of obvious things for the Tacos developers - but
> they're not as obvious to new users! Specially if they don't know Dojo).
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Tacos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tacos-devel








Reply via email to