I'm looking for some guidance on how best to have the value of text  
field that's been ajax-ified picked up on a regular submit.

What I mean is:

If I have a field of

   object word extends RequestVar("")

which I bind like this

     bind("f", xhtml,
        "word" -> SHtml.text(word,word(_)),
        "submit" -> SHtml.submit("GO",  processForm)
     )

and everything is lovely and this does what you expect:

     def processForm() = {
            Log.info("Submit from the form:")
            Log.info(word)
        }

Now I want to add some dynamic feedback for the user of the form so I  
switch to...

        "word" -> SHtml.ajaxText(word, checkWord(_))

with

  def checkWord(w:String) = {
       Log.info("Ajax check: "+w)
       Noop
     }


That also works just great.  But when the submit button is hit, of  
course there's now no-longer the assignment into word RequestVar  
anymore.  And I'd like there to be (regardless of if the Ajax  
checkWords is ever called or not).

So where should I be looking to insert the "word(_)" call to get the  
AJAX goodness but also the good old submit behaviour?

My current thinking is that I use a SHtml.text but then mess with the  
<input> that's created to include the appropriate Ajax calls I want.

Lift 1.1-SNAPSHOT on 2.7.5.final

Many thanks
Richard



--~--~---------~--~----~------------~-------~--~----~
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