Hi all,
I have this code :
class ViewClient
{
val clientId = S.param ("id") openOr ""
val client = try {
Client.findByKey (clientId.toLong)
}
catch {
case e:NumberFormatException => Empty
}
def view (inhtml: NodeSeq) : NodeSeq = {
client map ( { c =>
bind ("client", inhtml,
"firstName" -> c.firstName,
"lastName" -> c.lastName)
} ) openOr Text ("Client invalide")
}
}
class Client extends LongKeyedMapper [Client] with IdPK with OneToMany
[Long, Client]
{
def getSingleton = Client
object firstName extends MappedString (this, 256)
object lastName extends MappedString (this, 256)
A fairly simple view ...
I would like to call :
"firstName" -> c.firstName.asHtml
It would seem appropriate to me since c is a Client ...
But I get :
INFO] exception when traversing ((x$2: com.envirobiz.model.Client) => x
$2.firstName)
[INFO] exception when traversing client.map[object
com.envirobiz.model.Client#firstName](((x$2:
com.envirobiz.model.Client) => x$2.firstName))
[INFO] exception when traversing client.map[object
com.envirobiz.model.Client#firstName](((x$2:
com.envirobiz.model.Client) => x$2.firstName)).toString
[INFO] exception when traversing client.map[object
com.envirobiz.model.Client#firstName](((x$2:
com.envirobiz.model.Client) => x$2.firstName)).toString()
And more... until :
[ERROR] scala.tools.nsc.symtab.Types$TypeError: type mismatch;
[INFO] found : x$2.firstName.type (with underlying type object x
$2.firstName)
[INFO] required: com.envirobiz.model.Client#firstName.type
If I do not do asHtml it works properly...
Also this works in other contexts like :
toShow.flatMap (client =>
bind ("client", inhtml,
"firstName" -> client.firstName.asHtml,
In another list view .. so i'm confused ...
Any ideas ?
Thanks
hexa
--
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.