Hi Ari,
This is how I used to use FormData.
First, you'll need to create a function with a guid on the Scala side. I used this:
object JsonCallbackFuncName {
def apply(callback: JValue => JsCmd): String = {
S.fmapFunc(S.SFuncHolder(s => LiftExtras.parseJsonFunc.vend(s, callback)))(name =>
name
)
}
}
val callBack = SnippetHelpers.JsonCallbackFuncName(getUsers)
You'll need to pass that guid to the client so it's accessible in JavaScript.
Then, on the JavaScript side:
const form = new FormData()
const myJson = {
x: 'x'
}
form.append("$callBack", JSON.stringify(myJson))
window.lift.ajax(form, null, null, null)
See the appendToQueue function in lift.js to see what those arguments are.
This version uses JSON in one of the form fields, which you may or may not want, but this should get you headed in the right direction.
Tim