[Lift] Re: ajax form that submits multiple values?

2009-04-21 Thread ivan

Hi and thanks!

That helps and now the form is submitted and the function
'processEntryAdd' is called. But I would like to have something like:

 "submit2" -> SHtml.ajaxButton("Add user - 2", () => {
processEntryAdd
SetHtml("userList", ) &
DisplayMessage("message1", Dodan korisnik, 3
seconds, 2 seconds)
}

I would like to have a part of the page rerendered (SetHtml and
DisplayMessage) but that piece of code doesn't work.

I must say that I like lift, but coming from a JSF background some
things seam harder to do at least until i have working code (than it
looks easier and cleaner) but getting to that point is sometimes a bit
hard :)

Is this with ajax forms a known bug? Is there some more info on it?
Plans to work on fixing it, I might try fixing it myself if pointed in
the right direction.

Thanks again for helping. :)

On Apr 21, 8:47 pm, David Pollak 
wrote:
> 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) ++  type="submit" value="Add User"/>
>
> Thanks,
>
> David
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Lift] Re: ajax form that submits multiple values?

2009-04-21 Thread David Pollak
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
-~--~~~~--~~--~--~---