Also, interestingly, if you change the order of binding from:
bind("cont", containerTemplate,
"name" -> { println("bind container name " + cont.name);
SHtml.text(cont.name,
(s: String) => {println("set container name " + s); cont.name =
s; }) },
"rooms" -> editRoom _,
"addRoom" -> ajaxButton(Text("Add"), "cont_edit",
() => { println("executing funtion"); cont.rooms += new Room; reDraw })
)
to:
bind("cont", containerTemplate,
"rooms" -> editRoom _,
"addRoom" -> ajaxButton(Text("Add"), "cont_edit",
() => { println("executing funtion"); cont.rooms += new Room; reDraw }),
"name" -> { println("bind container name " + cont.name);
SHtml.text(cont.name,
(s: String) => {println("set container name " + s); cont.name =
s; }) }
)
then the container name is also lost on submit. The log output is then:
executing funtion
bind container name
bind room name
bind room name
set container name container
set room name room
Adam
On Jan 13, 2010, at 10:13 AM, Adam Warski wrote:
> Hello,
>
>> Yes please a small app would be best. Please use 2.0-SNAPSHOT.
>
> Here it is:
> http://github.com/adamw/lift-ajax-submit-test/
>
> Steps to reproduce:
> 1. checkout from git :)
> 2. run mvn jetty:run
> 3. go to http://localhost:8080
> 4. click "add" once
> 5. fill in the two fields with some values e.g. "container", "room"
> 6. click add again
> 7. the "container" value will stay, while the "room" value will disappear. In
> the logs, you can see:
>
> set container name cont
> executing funtion
> bind container name cont
> bind room name
> bind room name
> set room name room
>
>> Also please see this thread:
>> http://groups.google.com/group/liftweb/browse_thread/thread/75750c42ec3a2d7d?hl=en#
> Yeah, I saw it, as far as I understand the ajaxSubmit is more or less the
> same as the ajaxButton you did (and I corrected)?
>
> Thanks,
> 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.
>
>
--
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.