Okay, I think I may have found a bug. My returned content contains unescaped braces. In one failure case (this is parsing a DSL) I was testing a parse of a missing end brace - and part of the error message is the original text passed in (with mismatched braces).
Figured it out by passing in content with a superfluous end brace - that error returns fine. :) Thought I was going nuts. Kris On Thu, Jan 21, 2010 at 5:08 PM, David Pollak <feeder.of.the.be...@gmail.com> wrote: > > > On Thu, Jan 21, 2010 at 4:04 PM, Kris Nuttycombe <kris.nuttyco...@gmail.com> > wrote: >> >> On Thu, Jan 21, 2010 at 4:36 PM, Kris Nuttycombe >> <kris.nuttyco...@gmail.com> wrote: >> > On Thu, Jan 21, 2010 at 2:43 PM, Marius <marius.dan...@gmail.com> wrote: >> >> >> >> >> >> On Jan 21, 11:15 pm, Kris Nuttycombe <kris.nuttyco...@gmail.com> >> >> wrote: >> >>> On Thu, Jan 21, 2010 at 12:23 PM, Marius <marius.dan...@gmail.com> >> >>> wrote: >> >>> > Instead of >> >>> >> >>> > "submit" -> SHtml.submit("Parse", () => ()) >> >>> >> >>> > use: >> >>> >> >>> > "submit" -> SHtml.ajaxSubmit("Parse", () => ()) >> >>> >> >>> > you can also send normal forms via ajax like: >> >>> >> >>> > SHtml.submitAjaxForm("formId", () => { >> >>> >> >>> > /// Do your stuff here. This function will be called after form >> >>> > field functions are executed. >> >>> > Noop >> >>> > }) >> >>> >> >>> > Br's, >> >>> > Marius >> >>> >> >>> Thanks, Marius. I've just updated from M1 to the snapshot to get >> >>> ajaxSubmit; however, it doesn't address my question as to why the >> >>> function passed to AjaxSubmit doesn't return a JsCmd that can be used >> >>> to refresh the page. >> >> >> >> The ajaxSubmit has the signature: >> >> >> >> def ajaxSubmit(value: String, func: () => Any, attrs: (String, String) >> >> *) >> >> >> >> returns an Any because Lift looks for the following: >> >> >> >> JsCmd, >> >> NodeSeq >> >> JsCommands >> >> LiftResponse >> > >> > I think I must be misunderstanding something - should I expect the >> > following to work? >> > >> > var text: Option[String] = None >> > ajaxForm( >> > bind("plan", xhtml, >> > "dsl" -> textarea("", s => text = Some(s), "id" -> >> > "dsl_text", "rows" -> "40", "cols" -> "120"), >> > "submit" -> ajaxSubmit("Create Plan", () => >> > SetHtml("results", buildPlan(text.get))) >> > ) >> > ) >> > >> > where there is <div id="results"/> in the rendered page? I don't seem >> > to get the expected results back, though it's clear from logging that >> > this is being processed correctly. >> > >> > Kris >> > >> >> A bit more, intriguing information: is SetHtml size-limited? It seems >> to work fine if what I'm passing back is just a URL or something, but >> if I pass back a 1.5k error message, the message never seems to >> appear. > > It's not size limited AFAIK. Some browsers may have a limit on String > length or the ability to parse super-long JavaScript, but you're probably > looking at 16M (24 bits). > >> >> Kris >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Lift" group. >> To post to this group, send email to lift...@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, the simply functional web framework http://liftweb.net > Beginning Scala http://www.apress.com/book/view/1430219890 > Follow me: http://twitter.com/dpp > Surf the harmonics > > -- > You received this message because you are subscribed to the Google Groups > "Lift" group. > To post to this group, send email to lift...@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. > -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@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.