I've disappeared down a bit of a rabbit hole here and I'm a bit confused by how Lift's functionality has developed in this regard.
Originally I had a form with good ol' SHtml.text et al bindings. It worked.
My page was redesigned and I had the requirement to save the state of the form as the user was editing it. So I started using SHtml.ajaxText et al. This worked to save the state as I was editing it. But then I noticed no other fields were being set when I submitted the form (with the SHtml.hidden() trick).
I looked at the HTML and noticed that while the onblur etc events are generated, the name attribute is the same as before CssSel binding. When I look at the form submission I can see the form elements are not submitted with "F****" names, rather those original CssSel binding names, and so I guess that's why the values aren't bound at submission time.
I expected the Ajax form to just work the same way as a normal submit (albeit with the SHtml.hidden() trick because of the JQ JSON serialisation issue).
So what should I be doing:
- Should the Ajax form work on normal submission, as I expected, and all my SHtml.ajaxText et al elements have their functions called? Therefore there's a bug in my code
or
- Should I be using plain old SHtml.text et al and using onEvent to code my own [onblur] etc handlers?
Ta,
Dan