Created
December 16, 2011 03:36
-
-
Save totem3/1484329 to your computer and use it in GitHub Desktop.
ajaxText
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<lift:surround with="default" at="content"> | |
<lift:AjaxTextTest.greeting> | |
greeting1: <greeting:text /> | |
<div id="here" /> | |
</lift:AjaxTextTest.greeting> | |
<lift:AjaxTextTest.greeting2> | |
greeting2: <greeting:text /> | |
<div id="here2" /> | |
</lift:AjaxTextTest.greeting2> | |
<lift:AjaxTextTest.greeting3> | |
greeting3: <greeting:text /> | |
<div id="here3" /> | |
</lift:AjaxTextTest.greeting3> | |
</lift:surround> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AjaxTextTest { | |
def greeting(xhtml:NodeSeq):NodeSeq = { | |
bind("greeting", xhtml, | |
"text" -> ajaxText("YourName", (s:String)=> SetHtml("here", Text("Hello, " + s + "!"))) | |
) | |
} | |
def greeting2(xhtml:NodeSeq):NodeSeq = { | |
bind("greeting", xhtml, | |
"text" -> ajaxText("YourName", true, (s:String)=> SetHtml("here2", Text("Hello, " + s + "!"))) | |
) | |
} | |
def greeting3(xhtml:NodeSeq):NodeSeq = { | |
bind("greeting", xhtml, | |
"text" -> ajaxText("YourName", false, Call("alert('Hello!')"), (s:String) => SetHtml("here3", Text("Hello, " + s + "!"))) | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment