How about: trait AbstractPersistentChannel[T <: AbstractPersistentChannel[T]] extends LongKeyedMetaMapper[T] { self: T =>} trait AbstractPersistentMetaChannel[T <: AbstractPersistentChannel[T]] extends LongKeyedMetaMapper[T] { self: T =>}
class ChannelA extends AbstractPersistentChannel[ChannelA] class ChannelB extends AbstractPersistentChannel[ChannelB] // And there are some objects which use that trait: object ChannelA extends ChannelA with AbstractPersistentMetaChannel[ChannelA] object ChannelB extends ChannelB with AbstractPersistentMetaChannel[ChannelB] type SomeMetaT = T forSome {type T <: AbstractPersistentMetaChannel[T]} // I now have a list of those and have a can to store an element of that list:: var cType: Can[AbstractPersistentMetaChannel[SomeMetaT]] = Empty def showForm: JsCmd = { val form = cType.map(_.create.toForm(Empty, c => c.save())) openOr Nil JsCmds.Noop } On Wed, Dec 10, 2008 at 11:41 AM, Joachim A. <[EMAIL PROTECTED]>wrote: > > Hi, > I hope this is not off-topic here. > I have the problem that I can't find a type declaration for a collection of > MetaMappers so that create.save works on the meta mapper. > > I have a base class for a certain kind of mappers and the same for the meta > class (I don't show the MetaMappers which are used here): > > trait AbstractPersistentMetaChannel[T <: AbstractPersistentChannel[T]] > extends > LongKeyedMetaMapper[T] { self: T =>} > > And there are some objects which use that trait: > object ChannelA extends ChannelA with > AbstractPersistentMetaChannel[ChannelA] > object ChannelB extends ChannelB with > AbstractPersistentMetaChannel[ChannelB] > > I now have a list of those and have a can to store an element of that > list:: > var cType: Can[AbstractPersistentMetaChannel[_ <: > AbstractPersistentChannel[_]]] = Empty > > def showForm: JsCmd = { > val form = cType.map(_.create.toForm(Empty, c => c.save)) openOr > NodeSeq.Empty > //... > } > > The compiler complains: > [WARNING] Channels.scala:74: error: value save is not a member of _$2 > [WARNING] val form = cType.map(t => t.create.toForm(Empty, c => > {c.save;ChannelList.startChannel(c)})) openOr NodeSeq.Empty > > > Is there any way to define the type of cType so that save works? > > Hopefully I was able to explain the problem :) Any helps is appreciated, > Joachim > > > > > -- 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 --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---