On Wed, May 6, 2009 at 1:17 PM, Tobias Daub <[email protected]> wrote:
> CrudType is a type parameter, or? Its not the class nor companion object > that mixes in CRUDify...? Because I tried that, too. I got a compiler error > anyway => error: not found: type CrudType > CrudType is whatever the model class and meta object are. You have to change this to User or Project or whatever's being crudified. > > > Does the "owner" field belong to CRUDify? I got a bit confused, because I > added such a field to my class by hand. > No... it's whatever the field in your model that is valid for the current user. The By(CrudType.owner, User.currentUser) is a placeholder for whatever clauses are required to only list the records that the user is allowed to see. > > > The link from the API docs is dead: > > http://scala-tools.org/scaladocs/liftweb/1.0/net/liftweb/mapper/CRUDify.CrudType.html > > > thanks > > > > David Pollak schrieb: > > > > On Tue, May 5, 2009 at 12:35 PM, Tobias Daub <[email protected]> wrote: > >> >> Hello List, >> >> I've some more questions about CRUDify! The sources aren't helping me so >> much and I really miss some more comments! (sorry) >> >> 1.) I wanna change the behaviour for listing "items", e.g. I only want >> to list items that belong to the logged in user. Is there any method I >> can override (def showAllMenuLoc: Box[Menu]) ? How? > > > > override def findForListParams: List[QueryParam[CrudType]] = > By(CrudType.owner, User.currentUser) :: super.findForListParams > > > >> >> >> >> 2.) Is there any chance to tell an object that it should display itself >> as a drop-down menu? There is something similar in the ToDo tutorial >> with the priority field, but I couldn't adapt it. What if I wanna >> display items in the drop-down menu that are from another database table >> (I wanna select entries from there). The priority field only contains >> integer values.... >> >> > You can override the _toForm method on the field that you want to display > as a select. > > See SHtml.selectObj() This will allow you to display a selection of > objects. > > If you need more of a detailed description, please post the MappedField > that you want displayed as a drop-down and we can work through the code > together. > > Thanks, > > David > > >> >> thanks >> >> >> > > > -- > Lift, the simply functional web framework http://liftweb.net > Beginning Scala http://www.apress.com/book/view/1430219890 > Follow me: http://twitter.com/dpp > Git some: http://github.com/dpp > > > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
