Hi all,

I have a normal form defined via bind.

object smlink extends RequestVar(Full(""))
  val widget = new Widget()

  def show(xhtml: NodeSeq): NodeSeq = {
    var smallLink = ""
    var dlText = ""

    if (smlink.isEmpty || smlink.open_!.length == 0) {
      Log.debug("Starting new widget generation")
    } else if (!smlink.open_!.startsWith("Error")) {
      Log.debug("Widget generation successfull")
      smallLink = smlink.open_!
      dlText = "Download here"
    } else {
      Log.debug("Widget generation unsuccessfull")
      dlText = smlink.open_!
    }

    bind("widget", xhtml,
      "title" -> text(widget.title, widget.title = _) % ("size" ->
"10") % ("id" -> "title"),
      "url" -> text(widget.url, widget.url = _) % ("size" -> "56") %
("id" -> "url"),
      "submit" -> submit("Generate", () => {
        smlink(Full(buildWidgetPackage(burl,widget)))
      }),
          "link" -> <a href={smallLink}>{dlText}</a>
    )
  }

After submit the inputs are tested and errors return a string with the
specific error message. The message is shown as link, but all the
inputs are gone after reloading the page to show the error.
Is there a way to get the widget object after submit to set the values
in the form to the submitted values? Maybe it is in smlink or should I
use a tuple to return the widget object from the buildWidgetPackage
function.

Thanks,
Torsten

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to