<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Try:<br><br>...<br>onSuccess: (html javascript refresh);<br>...<br><br>I've used something similar in the past.<br><br>RS<br><br><hr id="stopSpelling">From: joel.turnbull@ardishealth.com<br>Date: Mon, 5 Oct 2009 10:47:51 -0400<br>Subject: Re: [Seaside] Degrading Remove Button<br>To: seaside@lists.squeakfoundation.org<br><br><br>This is working great, Lukas, thank you.<br><br>One more question. What's the best way to trigger a refresh after the onClick callback?<br><br>My best guess is to add a hidden submit button with an empty callback, and activate it via onSuccess: or onComplete:, but I can't figure out how to trigger it because triggerFormElement: ignores submit callbacks. Maybe the hidden submit is not even necessary. Here's where I'm at...<br>
<br>html anchor<br>
onClick: (html scriptaculous request<br>
callback: [ self removeItem ];<br>
confirm: 'Are you sure to remove Foo?';<br> onSuccess: ( html scriptaculous request triggerFormElement: 'hiddenSubmit' );<br>
return: false);<br>
callback: [ (self confirm: 'Are you sure to remove?') ifTrue: [<br>
self removeItem ] ];<br>
with: 'remove'<br><br><br><br><br><div class="ecxgmail_quote">On Fri, Oct 2, 2009 at 12:56 PM, Lukas Renggli <span dir="ltr"><<a href="mailto:renggli@gmail.com">renggli@gmail.com</a>></span> wrote:<br><blockquote class="ecxgmail_quote" style="padding-left: 1ex;">
Try something along:<br>
<br>
html anchor<br>
onClick: (html scriptaculous request<br>
callback: [ self removeItem ];<br>
confirm: 'Are you sure to remove Foo?';<br>
return: false);<br>
callback: [ (self confirm: 'Are you sure to remove?') ifTrue: [<br>
self removeItem ] ];<br>
with: 'remove'<br>
<br>
Lukas<br>
<br>
2009/10/2 Joel Turnbull <<a href="mailto:joel.turnbull@ardishealth.com">joel.turnbull@ardishealth.com</a>>:<br>
<div><div></div><div class="h5">><br>
> I have a remove button that I'd like to pop a js confirmation dialog.<br>
><br>
> I'd like the button to degrade so that if js is disabled, the user will be<br>
> taken to a separate confirmation page, ala the WAComponent confirm:<br>
><br>
> Here's the closest I've gotten<br>
><br>
> html submitButton<br>
> onClick: 'return confirm(''Are you sure you wish to remove', aFoo<br>
> name,'?'')';<br>
> callback: [ self confirm: 'Are you sure you wish to remove', aFoo name,'?'<br>
> ];<br>
> with: each value<br>
><br>
> The problem with that is, the result of the js confirmation returning true<br>
> is the callback, which is another confirmation.<br>
><br>
> It seems like I need a separate callback to handle the result of the js<br>
> confim. Is that doable? Any other ideas?<br>
><br>
> I played around with the WAAsyncComponent onClickCallback: but that didn't<br>
> seem to do what I expected.<br>
><br>
> Thanks,<br>
> Joel<br>
><br>
</div></div>> _______________________________________________<br>
> seaside mailing list<br>
> <a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
> <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
><br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Lukas Renggli<br>
<a href="http://www.lukas-renggli.ch">http://www.lukas-renggli.ch</a><br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</font></blockquote></div><br>                                            <br /><hr />Hotmail: Free, trusted and rich email service. <a href='http://clk.atdmt.com/GBL/go/171222984/direct/01/' target='_new'>Get it now.</a></body>
</html>