[Lift] Re: bind and enumerations

2008-09-18 Thread Oliver
Ha that's it - I was hoping they would magically work like java enum's :) thanks Ol On Thu, Sep 18, 2008 at 2:33 PM, David Pollak [EMAIL PROTECTED] wrote: It's because you have to create each of the Enumeration's String representations manually: scala object Gender extends Enumeration {

[Lift] Re: bind and enumerations

2008-09-18 Thread Charles F. Munat
def add (xhtml : NodeSeq) : NodeSeq = { def doAdd () = { Model.em.merge(user) redirectTo(index) } val currentId = user.id var g: Can[Gender] = Empty bind( user, xhtml, id - SHtml.hidden({user.id = currentId}), nameLast - SHtml.text(user.nameLast,

[Lift] Re: bind and enumerations

2008-09-18 Thread David Pollak
Sorry. There was a bug in my code and the type inferencer didn't do its job: var g: Can[*Gender.Value*] = Empty selectObj*[Gender.Value]*(Gender.elements.toList.map(v = (v, v.toString)), g, v = g = Full(v)) One other this you can do in Gender is: val

[Lift] Re: bind and enumerations

2008-09-17 Thread David Pollak
var g: Can[Gender] = Empty SHtml.selectObj(Gender.elements.toList.map(v = (v, v.toString)), g, v = g = Full(v)) On Wed, Sep 17, 2008 at 7:33 PM, Charles F. Munat [EMAIL PROTECTED] wrote: I'm using an enumeration for Gender: @serializable object Gender extends Enumeration { type Gender

[Lift] Re: bind and enumerations

2008-09-17 Thread Charles F. Munat
And it gives me: error: missing parameter type gender - SHtml.selectObj(Gender.elements.toList.map(v = (v, v.toString)), g, v = g = Full(v)), ^ :-( Oliver wrote: When I saw this answer, I was really hoping it would work. Unfortunately,