[Seaside] Re: I would like to attach an onClick event according to
Bob Arning
arning at charm.net
Sun Feb 6 21:21:43 UTC 2011
On 2/6/11 2:35 PM, Fritz Schenk wrote:
> John, thank you for taking the time to recreate the test. It teaches me how to
> use Seaside more efficiently. Except for the<break>s it is exactly the
> http://jsbin.com/imuka5/2
>
> However, neither
> <myAttach> html button
>
> onClick: ((html jQuery expression: '#external_links a')
> onClick: 'return confirm("You are going to visit: "+ this.href)');
>
> with: 'Fritz''s Attach Click'.
> /myAttach>
> or,
> <yourAttach> html button
>
> onClick: ( (html jQuery expression: '#external_links a')
>
> call: 'click' with: ('return confirm("You are going to visit: " + this.href)'
> asFunction));
>
> with: 'My Attach Click'
> <yourAttach>
>
> Work. What the small application incorrectly brings up the inspector in the
> callback of the anchor without output of the confirm dialog.
> The reason being that the above two attaches are translated into code with
> the same problem. The embedded double quotes are the problem.
>
> <as per source in halos>
> <button onclick="$("#external_links a").click(function(){return confirm
> ("You are going to visit: "+ this.href)})" type="submit" class="submit">
> Fritz's Attach Click</button>
> <button onclick="$("#external_links a").click(function(){return confirm
> ("You are going to visit: " + this.href)})" type="submit" class="submit">
> My Attach Click</button>
> <as per source in halos>
>
> Notice that the onClick:... and call:... messages generate exactly the same code.
>
> I have reported this problem.
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
Fritz,
Not sure where you are seeing the embedded double quotes, but if I run
this code and View Source in my browser (Safari), it looks like Seaside
has sent this:
<button onclick="$("#external_links
a").click(function(){return confirm("You are going to visit:
"+ this.href)})" type="submit" class="submit">Fritz's Attach
Click</button>
<button onclick="$("#external_links
a").click(function(){return confirm("You are going to visit:
" + this.href)})" type="submit" class="submit">My Attach Click</button>
no errors noted in the error console, so I'm not sure where the error is
happening for you.
Also, (see attached snapshot) when I click on one of the anchors, I see
the confirm dialog. If I click Cancel, the dialog goes away and that's
it. If I click OK, then the callback is run (thus opening an inspector)
after dismissing the dialog. Note sure why this doesn't meet your
expectations.
Cheers,
Bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dialog.png
Type: image/png
Size: 49544 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110206/fdf2cbc7/dialog-0001.png
More information about the seaside
mailing list