Howdy,
This is a bug in how Ajax forms are submitted (it's a browser-level bug.)
The submit button is not serialized as part of the thing that's sent to the
server.
I'd suggest the following:
"submit" -> SHtml.hidden("Add user", processEntryAdd) ++
Thanks,
David
On Mon, Apr 20, 2009 at 5:05 AM, ivan wrote:
>
>
>
> I am just getting started with lift and I am now trying to change a
> normal form to an ajax form but the method processEntryAdd is never
> called.
>
> def addUser(xhtml : Group) : NodeSeq = {
>
>var firstName = ""
>var lastName = ""
>
>def processEntryAdd() {
>Log.info("processEntryAdd: " + firstName + ", " + lastName)
>}
>
>SHtml.ajaxForm(
>bind("entry", xhtml,
> "firstName" -> SHtml.text(firstName,
> (x) => {
> Log.info("Setting firstName to " + x);
> firstName = x
> }),
> "lastName" -> SHtml.text(lastName,
> (x) => {
> Log.info("Setting lastName to " + x);
> lastName = x
> }),
> "submit" -> SHtml.submit("Add user", processEntryAdd),
>))
> }
>
> Any idea how to achieve what I am trying to do, or why the code above
> doesn't work. The values of the two form fields are submitted when the
> button is pressed and the two local variables firstName and lastName
> are set but the function associated with SHtml.submit isn't called.
>
> Thanks!
>
> PS
> I also asked this question here:
>
> http://stackoverflow.com/questions/760097/scala-lift-framework-ajax-form-that-submits-multiple-values
>
> >
>
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---