On Wed, Nov 26, 2008 at 11:19 AM, Derek Chen-Becker
<[EMAIL PROTECTED]>wrote:
> Still getting the type error using an explicit List(...):
>
> [WARNING]
> /home/software/liftbook-demos/demo-record/src/main/scala/com/theliftbook/model/Entry.scala:50:
> error: type mismatch;
> [WARNING] found :
> List[net.liftweb.record.Field[_10,com.theliftbook.model.Entry] forSome {
> type _10 >: String with java.util.Calendar <: java.lang.Comparable[_1]
> forSome { type _1 >: java.lang.String with java.util.Calendar <:
> java.io.Serializable } with java.io.Serializable }{def defaultValue:
> java.lang.Comparable[_12] forSome { type _12 >: java.lang.String with
> java.util.Calendar <: java.io.Serializable } with java.io.Serializable}]
> [WARNING] required:
> List[net.liftweb.record.Field[_$3,com.theliftbook.model.Entry] forSome {
> type _$3 }]
> [WARNING] override def fieldOrder = List(date, description)
>
> Marius, I checked the commit and that looks reasonable. I'm using the
> snapshot repo right now so I'll modify my code to call
> Field.couldNotSetValue and test in the morning. Thanks!
>
I've checked in code that addresses this issue.
>
> Derek
>
> On Wed, Nov 26, 2008 at 10:35 AM, David Pollak <
> [EMAIL PROTECTED]> wrote:
>
>>
>>
>> On Wed, Nov 26, 2008 at 7:34 AM, Derek Chen-Becker <[EMAIL PROTECTED]
>> > wrote:
>>
>>> I'm in the process of playing with the Record code so I have some
>>> examples for the book. I've run into two small issues:
>>>
>>>
>>> 1. I'm writing a custom Field type (DecimalField) and it seems like
>>> the valueCouldNotBeSet var should be set if I can't parse the decimal
>>> string
>>> that a user hands me in setFromString. That var, however, is marked
>>> private[record], so I can't actually access it. Could you provide an
>>> accessor or make that var protected so that I can set it?
>>> 2. I'm getting a really weird type error if I try to override the
>>> fieldOrder def on MetaRecord:
>>>
>>>
>> Try this:
>>
>> object EntryMeta extends Entry with MetaRecord[Entry] {
>> override def fieldOrder = List(date, description)
>> }
>>
>>
>>>
>>> 1.
>>>
>>> [WARNING]
>>> /home/software/liftbook-demos/demo-record/src/main/scala/com/theliftbook/model/Entry.scala:50:
>>> error: type mismatch;
>>> [WARNING] found :
>>> List[net.liftweb.record.Field[_10,com.theliftbook.model.Entry] forSome {
>>> type _10 >: String with java.util.Calendar <: java.lang.Comparable[_1]
>>> forSome { type _1 >: java.lang.String with java.util.Calendar <:
>>> java.io.Serializable } with java.io.Serializable }{def defaultValue:
>>> java.lang.Comparable[_12] forSome { type _12 >: java.lang.String with
>>> java.util.Calendar <: java.io.Serializable } with java.io.Serializable}]
>>> [WARNING] required:
>>> List[net.liftweb.record.Field[_$3,com.theliftbook.model.Entry] forSome {
>>> type _$3 }]
>>> [WARNING] override def fieldOrder = date :: description :: Nil
>>>
>>> Here's my code:
>>>
>>> class Entry extends Record[Entry] {
>>> def meta = EntryMeta
>>>
>>> object date extends DateTimeField(this)
>>>
>>> object description extends StringField(this, 100)
>>> }
>>>
>>> object EntryMeta extends Entry with MetaRecord[Entry] {
>>> override def fieldOrder = date :: description :: Nil
>>> }
>>>
>>> Am I making a dumb mistake here, or is there some other weirdness going
>>> on?
>>>
>>> Thanks,
>>>
>>> Derek
>>>
>>>
>>>
>>
>>
>> --
>> 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
>>
>>
>>
>
> >
>
--
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 [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
-~----------~----~----~----~------~----~------~--~---