Hello,

> ajaxButton("Press me would ya'?", SHtml.submitAjaxForm
> (form_ID).toJsCmd, (some) => {
> 
> do your stuff here
> 
> })

Looking at the source code I think this might work, but I'm having trouble 
constructing the correct expression to pass to ajaxButton. The method signature 
requires a Call instance, and SHtml.submitAjaxForm results in a command 
(JsCmd). Is it possible to somehow combine the two?

Or maybe there is some other, lift-idomatic way to solve my problem?
I want to create a form with a list of elements, with three ajax buttons: add, 
remove and save (adding/removing a row and persisting the list).

By the way, I think there's a small inconsistency; there are 7 overloaded 
variants for ajaxButton:

ajaxButton(text: NodeSeq, func: () => JsCmd, attrs: (String, String)*): Elem
ajaxButton(text: String, func: () => JsCmd, attrs: (String, String)*): Elem

ajaxButton(text: NodeSeq, jsFunc: Call, func: () => JsCmd, attrs: (String, 
String)*): Elem
ajaxButton(text: String, jsFunc: Call, func: () => JsCmd, attrs: (String, 
String)*): Elem

ajaxButton(text: NodeSeq, jsExp: JsExp, func: String => JsCmd, attrs: (String, 
String)*): Elem

and the last one doesn't have a text: String counterpart. Also the javadoc for 
the last variant is missing information on what's "jsExp" and what's the 
argument passed to "func". My guess would be that jsExp is evaluated and the 
result passed to func on the server?

-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.


Reply via email to