The first Lift tutorial: a ToDo application

24 views
Skip to first unread message

David Pollak

unread,
Dec 5, 2008, 8:09:13 PM12/5/08
to liftweb
Folks,

I've got a first draft of the first Lift tutorial: a ToDo application.

The application demonstrates creating a new Lift project, creating a model, linking the view to logic, adding validation and form input to the model, creating forms, and doing Ajax calls.

I'm enclosing the PDF of the tutorial along with the resulting application.

Please let me know if you've got feedback on it.

Thanks,

David

--
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp
todo_steps.pdf
todo.tgz

TylerWeir

unread,
Dec 5, 2008, 9:18:33 PM12/5/08
to Lift
Looks good Dave, good clear explanations.

2 suggestions:
1.
1.13 Display and Editting to do items -->
1.13 Display and Editing to do items

2.
You may want to toss in a few screenshots of the app.

Ty

On Dec 5, 8:09 pm, "David Pollak" <feeder.of.the.be...@gmail.com>
wrote:
> Folks,
>
> I've got a first draft of the first Lift tutorial: a ToDo application.
>
> The application demonstrates creating a new Lift project, creating a model,
> linking the view to logic, adding validation and form input to the model,
> creating forms, and doing Ajax calls.
>
> I'm enclosing the PDF of the tutorial along with the resulting application.
>
> Please let me know if you've got feedback on it.
>
> Thanks,
>
> David
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Collaborative Task Managementhttp://much4.us
>  todo_steps.pdf
> 206KViewDownload
>
>  todo.tgz
> 9KViewDownload

Kris Nuttycombe

unread,
Dec 5, 2008, 9:36:29 PM12/5/08
to lif...@googlegroups.com
Very nice! On the minor typo front:

<lift:Util.out>
  Please Log In <b>Dude</b>
</lift:Uitl.out>

Should be

<lift:Util.out>
  Please Log In <b>Dude</b>
</lift:Util.out>

Kris

Kris Nuttycombe

unread,
Dec 5, 2008, 9:42:17 PM12/5/08
to lif...@googlegroups.com
Also, for consistency:

<table>
  <lift:show.users>
    <tr>
      <td><f:first_name>David</f:first_name></td>
      <td><f:last_name>Pollak</f:last_name></td>
    </tr>
  </lift:show.users>
</table>

=>

<table>
  <lift:Show.users>
    <tr>
      <td><f:first_name>David</f:first_name></td>
      <td><f:last_name>Pollak</f:last_name></td>
    </tr>
  </lift:Show.users>
</table>

philip

unread,
Dec 6, 2008, 6:58:41 AM12/6/08
to Lift
Its great! reading through it now. (sorry my comment isn't anymore
helpful than that)

On Dec 6, 9:09 am, "David Pollak" <feeder.of.the.be...@gmail.com>
wrote:
> Folks,
>
> I've got a first draft of the first Lift tutorial: a ToDo application.
>
> The application demonstrates creating a new Lift project, creating a model,
> linking the view to logic, adding validation and form input to the model,
> creating forms, and doing Ajax calls.
>
> I'm enclosing the PDF of the tutorial along with the resulting application.
>
> Please let me know if you've got feedback on it.
>
> Thanks,
>
> David
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Collaborative Task Managementhttp://much4.us
> todo_steps.pdf
> 206KViewDownload
>
> todo.tgz
> 9KViewDownload

Mateusz Fiołka

unread,
Dec 6, 2008, 3:49:33 AM12/6/08
to lif...@googlegroups.com
The IdPK paragraph explains trait behaviour in Scala but doesn't say what does this trait mean. One can suspect it flags the class to have primary key but it is not obvious.

lift:Util.out
I think  the name is too generic. I know it is a tutorial but it may be seen as kind of small "code smell". How about sticking to the meaning? TodoApp:whenLogged .. or sth like this?

"Lift will convert underscore separated names to CamelCase names when it looks up classes". Some small example maybe also useful.
This paragraph contains lot of rules which could be expressed better as a list .. maybe with a title: Things to remember when binding tags to classes.


Regards,
Mateusz

Matt Harrington

unread,
Dec 5, 2008, 8:23:29 PM12/5/08
to lif...@googlegroups.com
Two thumbs up!

---Matt

Dano

unread,
Dec 8, 2008, 1:27:29 PM12/8/08
to Lift
David,

Since I am really interested in view/logic separation, I focused on
sections 1.5 and 1.6. My overall feedback is that I really like
starting with the example and following up with the philosophy. Also,
you accomplished the goal of telling the reader how the separation is
accomplished as well as where the 'guard rails' are to enforcing a
proper separation. Finally, having attended the lift workshop and
trying to puzzle thru the ToDo example afterwards, I am thankful for
this document so that I can gain a proper understanding of what is
going on.

In section 1.5, you describe the snippet lookup mechanism. There is a
sentence which I don't understand:

Lift will convert underscore separated names to
CamelCase names when it looks up classes.

I am having trouble understanding which underscores you are referring
to.


In section 1.6 there is a code snippet which looks like:
<td><f:year>
<select><option>2007</option></select>
</f:year></td>

The year snippet replaces the <select /> above with a <select>
generated from the snippet code. If I want the HTML designer to be
able to style the above select with css code, what is the guideline?
Should the select above have a class attribute? Also, if I want my
view to be testable, should I include an id attribute as well?

I really enjoyed the example and will dive in further as time permits.

Thanks.


Dano




On Dec 5, 5:09 pm, "David Pollak" <feeder.of.the.be...@gmail.com>
wrote:
> Folks,
>
> I've got a first draft of the first Lift tutorial: a ToDo application.
>
> The application demonstrates creating a new Lift project, creating a model,
> linking the view to logic, adding validation and form input to the model,
> creating forms, and doing Ajax calls.
>
> I'm enclosing the PDF of the tutorial along with the resulting application.
>
> Please let me know if you've got feedback on it.
>
> Thanks,
>
> David
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Collaborative Task Managementhttp://much4.us
>  todo_steps.pdf
> 206KViewDownload
>
>  todo.tgz
> 9KViewDownload

David Pollak

unread,
Dec 15, 2008, 2:53:24 PM12/15/08
to lif...@googlegroups.com
Fixed.
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us

David Pollak

unread,
Dec 15, 2008, 2:53:47 PM12/15/08
to lif...@googlegroups.com
Changed
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us

David Pollak

unread,
Dec 15, 2008, 2:55:51 PM12/15/08
to lif...@googlegroups.com
On Mon, Dec 8, 2008 at 10:27 AM, Dano <dan_o...@yahoo.com> wrote:

David,

Since I am really interested in view/logic separation, I focused on
sections 1.5 and 1.6.  My overall feedback is that I really like
starting with the example and following up with the philosophy.  Also,
you accomplished the goal of telling the reader how the separation is
accomplished as well as where the 'guard rails' are to enforcing a
proper separation.  Finally, having attended the lift workshop and
trying to puzzle thru the ToDo example afterwards, I am thankful for
this document so that I can gain a proper understanding of what is
going on.

In section 1.5, you describe the snippet lookup mechanism.  There is a
sentence which I don't understand:

             Lift will convert underscore separated names to
CamelCase names when it looks up classes.

I am having trouble understanding which underscores you are referring
to.


In section 1.6 there is a code snippet which looks like:
     <td><f:year>
          <select><option>2007</option></select>
      </f:year></td>

Dan,

Good suggestion.  I'm about to commit up code that will allow you to do:

<td>
<f:year f:id="FruitBat" f:class="myFruit">
 ....
</f:year>
</td>
 
The <select> tag that is bound to will have its id attribute set to "FruitBat" and its class attribute set to "myFruit"

Thanks,

David




--
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Reply all
Reply to author
Forward
0 new messages