[Lift] Re: Ajax example from the book

2009-09-14 Thread Daniel Nelson

If you're referring to the Exploring Lift book, have a look at Section
3.11.1 Binding Values in Snippets where it explains bind. (I'm new
to Lift myself and hopefully not leading you astray.)

1. myFunc's html parameter is fed automatically by the HTML Lift
Template.  In the follow example, everything between
lift:SomeClass.myFunc and /lift:SomeClass.myFunc is passed to
myFunc.

lift:surround with=default at=content
h2Hello World/h2
lift:SomeClass.myFunc form=POST
p Some Text hello:description //p
hello:button /
/lift:SomeClass.myFunc
/lift:surround


2. hello is a prefix for referring to template elements by name. The
HTML Lift template should have some like hello:button / which will
get replaced by the evaluation after - within bind().

3. I'm not sure what you mean How does the div work.


On Sep 13, 10:24 pm, jack jack.wid...@gmail.com wrote:
 Could somebody please explain to me how this example from the book
 works.

  def myFunc(html:NodeSeq):NodeSeq  = {
         bind(hello,html,button -
          ajaxButton(Text(Press me),
                     { () =
                       println(Got an Ajax call.)
                      SetHtml(my-div, Text(That's it))
                    })
        )
   }

 In particular, what do I pass in as the html parameter?
 What is 'hello'?
 How does the div work?

 I don't understand 'bind'.

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



[Lift] Re: Ajax example from the book

2009-09-14 Thread Derek Chen-Becker
I think that he's referring to the SetHtml, which is actually a JsExp that
has to be returned from any Ajax functions (the javascript is returned to
the client and executed). In the case of the example code, it will set the
contents of the div with the id my-div to a single Text element of That's
it.

Derek

On Mon, Sep 14, 2009 at 7:52 AM, Daniel Nelson dpn53...@gmail.com wrote:


 If you're referring to the Exploring Lift book, have a look at Section
 3.11.1 Binding Values in Snippets where it explains bind. (I'm new
 to Lift myself and hopefully not leading you astray.)

 1. myFunc's html parameter is fed automatically by the HTML Lift
 Template.  In the follow example, everything between
 lift:SomeClass.myFunc and /lift:SomeClass.myFunc is passed to
 myFunc.

 lift:surround with=default at=content
h2Hello World/h2
lift:SomeClass.myFunc form=POST
p Some Text hello:description //p
hello:button /
/lift:SomeClass.myFunc
 /lift:surround


 2. hello is a prefix for referring to template elements by name. The
 HTML Lift template should have some like hello:button / which will
 get replaced by the evaluation after - within bind().

 3. I'm not sure what you mean How does the div work.


 On Sep 13, 10:24 pm, jack jack.wid...@gmail.com wrote:
  Could somebody please explain to me how this example from the book
  works.
 
   def myFunc(html:NodeSeq):NodeSeq  = {
  bind(hello,html,button -
   ajaxButton(Text(Press me),
  { () =
println(Got an Ajax call.)
   SetHtml(my-div, Text(That's it))
 })
 )
}
 
  In particular, what do I pass in as the html parameter?
  What is 'hello'?
  How does the div work?
 
  I don't understand 'bind'.

 


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



[Lift] Re: Ajax example from the book

2009-09-14 Thread Jack Widman
Thanks. Yes thats what I meant.

On Mon, Sep 14, 2009 at 3:42 PM, Derek Chen-Becker dchenbec...@gmail.comwrote:

 I think that he's referring to the SetHtml, which is actually a JsExp that
 has to be returned from any Ajax functions (the javascript is returned to
 the client and executed). In the case of the example code, it will set the
 contents of the div with the id my-div to a single Text element of That's
 it.

 Derek


 On Mon, Sep 14, 2009 at 7:52 AM, Daniel Nelson dpn53...@gmail.com wrote:


 If you're referring to the Exploring Lift book, have a look at Section
 3.11.1 Binding Values in Snippets where it explains bind. (I'm new
 to Lift myself and hopefully not leading you astray.)

 1. myFunc's html parameter is fed automatically by the HTML Lift
 Template.  In the follow example, everything between
 lift:SomeClass.myFunc and /lift:SomeClass.myFunc is passed to
 myFunc.

 lift:surround with=default at=content
h2Hello World/h2
lift:SomeClass.myFunc form=POST
p Some Text hello:description //p
hello:button /
/lift:SomeClass.myFunc
 /lift:surround


 2. hello is a prefix for referring to template elements by name. The
 HTML Lift template should have some like hello:button / which will
 get replaced by the evaluation after - within bind().

 3. I'm not sure what you mean How does the div work.


 On Sep 13, 10:24 pm, jack jack.wid...@gmail.com wrote:
  Could somebody please explain to me how this example from the book
  works.
 
   def myFunc(html:NodeSeq):NodeSeq  = {
  bind(hello,html,button -
   ajaxButton(Text(Press me),
  { () =
println(Got an Ajax call.)
   SetHtml(my-div, Text(That's it))
 })
 )
}
 
  In particular, what do I pass in as the html parameter?
  What is 'hello'?
  How does the div work?
 
  I don't understand 'bind'.




 


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



[Lift] Re: Ajax example from the book

2009-09-14 Thread Jack Widman
I was referring to that book. Is there another? :)
Thanks for your help Daniel.

On Mon, Sep 14, 2009 at 9:52 AM, Daniel Nelson dpn53...@gmail.com wrote:


 If you're referring to the Exploring Lift book, have a look at Section
 3.11.1 Binding Values in Snippets where it explains bind. (I'm new
 to Lift myself and hopefully not leading you astray.)

 1. myFunc's html parameter is fed automatically by the HTML Lift
 Template.  In the follow example, everything between
 lift:SomeClass.myFunc and /lift:SomeClass.myFunc is passed to
 myFunc.

 lift:surround with=default at=content
h2Hello World/h2
lift:SomeClass.myFunc form=POST
p Some Text hello:description //p
hello:button /
/lift:SomeClass.myFunc
 /lift:surround


 2. hello is a prefix for referring to template elements by name. The
 HTML Lift template should have some like hello:button / which will
 get replaced by the evaluation after - within bind().

 3. I'm not sure what you mean How does the div work.


 On Sep 13, 10:24 pm, jack jack.wid...@gmail.com wrote:
  Could somebody please explain to me how this example from the book
  works.
 
   def myFunc(html:NodeSeq):NodeSeq  = {
  bind(hello,html,button -
   ajaxButton(Text(Press me),
  { () =
println(Got an Ajax call.)
   SetHtml(my-div, Text(That's it))
 })
 )
}
 
  In particular, what do I pass in as the html parameter?
  What is 'hello'?
  How does the div work?
 
  I don't understand 'bind'.

 


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



[Lift] Re: Ajax example from the book

2009-09-14 Thread Randinn

Not at the moment but it does have a group

http://groups.google.com/group/the-lift-book

On Sep 15, 5:45 am, Jack Widman jack.wid...@gmail.com wrote:
 I was referring to that book. Is there another? :)
 Thanks for your help Daniel.

 On Mon, Sep 14, 2009 at 9:52 AM, Daniel Nelson dpn53...@gmail.com wrote:

  If you're referring to the Exploring Lift book, have a look at Section
  3.11.1 Binding Values in Snippets where it explains bind. (I'm new
  to Lift myself and hopefully not leading you astray.)

  1. myFunc's html parameter is fed automatically by the HTML Lift
  Template.  In the follow example, everything between
  lift:SomeClass.myFunc and /lift:SomeClass.myFunc is passed to
  myFunc.

  lift:surround with=default at=content
         h2Hello World/h2
         lift:SomeClass.myFunc form=POST
                 p Some Text hello:description //p
                 hello:button /
         /lift:SomeClass.myFunc
  /lift:surround

  2. hello is a prefix for referring to template elements by name. The
  HTML Lift template should have some like hello:button / which will
  get replaced by the evaluation after - within bind().

  3. I'm not sure what you mean How does the div work.

  On Sep 13, 10:24 pm, jack jack.wid...@gmail.com wrote:
   Could somebody please explain to me how this example from the book
   works.

    def myFunc(html:NodeSeq):NodeSeq  = {
           bind(hello,html,button -
            ajaxButton(Text(Press me),
                       { () =
                         println(Got an Ajax call.)
                        SetHtml(my-div, Text(That's it))
                      })
          )
     }

   In particular, what do I pass in as the html parameter?
   What is 'hello'?
   How does the div work?

   I don't understand 'bind'.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---