Hello,
>> However for some reason, when I click the button, in the callback I get a
>> new elements RequestVar (so it's initialized to an initial value) and
>> moreover, nothing gets redrawn on the page. What is also quite weird is that
>> the RequestVar is re-initialized, but the snippet instance stays the same.
>> Any ideas? :)
>
> Yes I think so. You have a regular form with fields like: (SHtml.text.
> SHtml.hidden etc. right? RequestVars are kept around into a "snapshot-
> restorer" only for ajax functions (like for ajaxText etc) and not for
> regular fields forms. Thus in the Scala function of a SHtml.ajaxText
> you'll see the RequestVar set when the page was rendered because its
> state is preserved on purpose by lift. However for regular fields this
> is not happening. So there is a difference between an ajax-form and
> ajax fields. Even your form is sent via ajax, the fields are regular
> fields not ajax fields (... ajax fields do not even need to live
> inside a form). Therefore for your case the RequestVar's are not
> preserved and they are renewed when the request comes in. You can keep
> around that state using a SessionVar.
Ah, clear now. And it even works, thanks a lot for the help! :)
--
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.