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 {
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,
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
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
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,