[Lift] Re: Javascript "confirm(..)" dialog with ajaxButton

2009-04-29 Thread David Pollak
On Tue, Apr 28, 2009 at 10:39 PM, marius d. wrote: > > Still there might be situations when users do not use blockUI (I > encountered such situation when having a really fancy dialog) and > blockUI was screwing it up a bit. So for more complex cases where the > dialog function is much more comple

[Lift] Re: Javascript "confirm(..)" dialog with ajaxButton

2009-04-29 Thread David Pollak
On Wed, Apr 29, 2009 at 12:16 AM, marius d. wrote: > > Ok, > > Here is what I'm thinking of: > > def ajaxButton(text: NodeSeq, jsFunc: Call, func: () => JsCmd, > attrs: (String, String)*): Elem = { > >val params = (name: String) => jsFunc.params ++ List(AnonFunc > (makeAjaxCall(Str(name+"=tr

[Lift] Re: Javascript "confirm(..)" dialog with ajaxButton

2009-04-29 Thread marius d.
Ok, Here is what I'm thinking of: def ajaxButton(text: NodeSeq, jsFunc: Call, func: () => JsCmd, attrs: (String, String)*): Elem = { val params = (name: String) => jsFunc.params ++ List(AnonFunc (makeAjaxCall(Str(name+"=true" attrs.foldLeft(fmapFunc(func)(name => {text}))

[Lift] Re: Javascript "confirm(..)" dialog with ajaxButton

2009-04-28 Thread marius d.
Still there might be situations when users do not use blockUI (I encountered such situation when having a really fancy dialog) and blockUI was screwing it up a bit. So for more complex cases where the dialog function is much more complex I tend to think that we need something more generic. Oh and

[Lift] Re: Javascript "confirm(..)" dialog with ajaxButton

2009-04-28 Thread Chris Forkin
Hi David, I copied the ajaxButton method from SHtml and created an ajaxConfirmButton that called "confirm(...)" before conditionally executing the method, but your solution is much more elegant. It's exactly what I was after. You might want to post this on the wiki somewhere (maybe in a cookbook o

[Lift] Re: Javascript "confirm(..)" dialog with ajaxButton

2009-04-28 Thread David Pollak
Here's an example of a confirm dialog box. Hope it helps. PS -- I grew up in Rhode Island. On Tue, Apr 28, 2009 at 1:15 PM, Derek Chen-Becker wrote: > I agree. Allowing for a "guard" JavaScript expression to be called before > the Ajax call is made would be nice. > > Derek > > > On Tue, Apr 28,

[Lift] Re: Javascript "confirm(..)" dialog with ajaxButton

2009-04-28 Thread Derek Chen-Becker
I agree. Allowing for a "guard" JavaScript expression to be called before the Ajax call is made would be nice. Derek On Tue, Apr 28, 2009 at 3:02 PM, marius d. wrote: > > Pretty much all SHtml function related to Ajax invokes the ajax call > as to click the link, button, etc. SHtml.ajaxCall fun

[Lift] Re: Javascript "confirm(..)" dialog with ajaxButton

2009-04-28 Thread marius d.
Pretty much all SHtml function related to Ajax invokes the ajax call as to click the link, button, etc. SHtml.ajaxCall function allow you to provide a JsExp (which could be any JavScript expression) who's result would be passed to the ajax call. But I don't think this will help your case a whole l

[Lift] Re: Javascript "confirm(..)" dialog with ajaxButton

2009-04-27 Thread Chris
Hi Tim, just one addition. Wicket has something called an ajaxcall decorator (IAjaxCallDecorator) that allows you to modify the script and more specifically the "decorateScript" method allows you to prepend a char- sequence to the script. This would allow me to do exactly what I want. Is there any

[Lift] Re: Javascript "confirm(..)" dialog with ajaxButton

2009-04-27 Thread Chris
Hi Tim, not sure if I really got across what I need. I need the AJAX functionality in this case as I'm displaying a large amount of data in a table and would like to allow the user to delete individual records without the refresh problem of having the button cause a POST. I also need to make sure

[Lift] Re: Javascript "confirm(..)" dialog with ajaxButton

2009-04-27 Thread Timothy Perrett
Hey, Seems like you have a couple of options... 1. you could just write normal javascript irrespective of lift and just put that in a JS file like normal. Something like: $('#mybutton').click(function(e){ confirm... //blah blah code here }); 2. If you *really* want to use the on-click handle