I found the error a few minutes after my post and verified it in code once I got home.
Basically in code as follows, I introduced web server side code that does not belong instead of pure constructs converting to JavaScript.
Mine after fix:
RedirectTo(whence, () => {
S.notice("Store:" + store)
// Garbage unwanted irrelevant code removed (going to do a client http get call)
if (prod.isDefined) {
S.notice("Product Name:" + prod.get.name)
} else {
Noop
}
Corresponding Easy-Lift AjaxExample 4.8
http://simply.liftweb.net/index-4.8.html#prev (his case Full(a) => RedirectTo corresponds to my code above).
def
process()
:
JsCmd
=
{
// sleep for 400 millis to allow the user to
// see the spinning icon
Thread.sleep(
400
)
// do the matching
asInt(age)
match
{
// display an error and otherwise do nothing
case
Full(a)
if
a <
13
=
> S.error(
"age"
,
"Too young!"
); Noop
// redirect to the page that the user came from
// and display notices on that page
case
Full(a)
=
> {
RedirectTo(whence, ()
=
> {
S.notice(
"Name: "
+name)
S.notice(
"Age: "
+a)
})
}
// more errors
case
_
=
> S.error(
"age"
,
"Age doesn't parse as a number"
); Noop