On Sun, Nov 1, 2009 at 2:00 PM, Randinn <rand...@gmail.com> wrote: > > I'm trying to generate a list of users onto the screen but am unable > to see the model here's me code so far > > package com.scalalist.project.snippet > > import com.scalalist.project.model.User > import net.liftweb.util.BindHelpers._ > import scala.xml._ > > > class ListUser { > > def list(html: NodeSeq) : NodeSeq = { > toShow.flatMap(item => >
This should read: toShow.flatMap(user => > bind("user", html, > "firstName" -> user.firstName, > "lastName" -> user.lastName, > "email" -> user.email, > "locale" -> user.locale, > "timezone" -> user.timezone, > FuncAttrBindParam("view_href", _ => > Text("view/"+ (user.primaryKeyField)),"href"), > FuncAttrBindParam("edit_href", _ => > Text("edit/"+ (user.primaryKeyField)),"href"), > FuncAttrBindParam("delete_href", _ => > Text("delete/"+ (user.primaryKeyField)),"href") > ) > ) > } > > private def toShow = > User.findAll(); > > } > > __________ > > <lift:surround with="default" at="content"> > <table> > <thead> > <tr> > <th>First Name</th> > <th>Last Name</th> > <th>Email</th> > <th>Locale</th> > <th>Timezone</th> > <th>View</th> > <th>Edit</th> > <th>Delete</th> > </tr> > </thead> > > <tbody class="stripeMe"> > <lift:ListUser.list > > <td><user:firstName/></td> > <td><user:lastName/></td> > <td><user:email/></td> > <td><user:locale/ > <td><user:timezone/></td> > <td><a user:view_href="">View</a></td> > <td><a user:edit_href="">Edit</a></td> > <td><a user:delete_href="">Delete</a></td> > </tr> > </lift:ListUser.list> > </tbody> > </table> > </lift:surround> > > > How can I get it to see the model objects? I've noticed ModelView > would that be a better way? > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---