<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="gmail_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="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; 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" target="_blank">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" target="_blank">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" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</font></blockquote></div><br>