Hello!
I've got a problem using SHtml.select and SHtml.selectObj. In my
little application.
def create(xhtml:NodeSeq):NodeSeq = {
val teams = Team.findAll
var localTeam:Team = Team.create
var visitorTeam:Team = Team.create
var teamOptions = teams.map(team => (team, team.teamName.is))
def submit () {
val aMatch = Match.create.local(localTeam).visitor
(visitorTeam)
aMatch.save
}
bind("m", xhtml,
"local" -> SHtml.selectObj(teamOptions, Empty,
(team:Team) => localTeam = team),
"visitor" -> SHtml.selectObj(teamOptions, Empty,
(team:Team) => visitorTeam = team),
"submit" -> SHtml.submit("Submit", submit))
}
}
When i submit this form, i create a Match mapper object where i set my
localTeam and my visitorTeam but the visitorTeam is never the one i've
just chosen in my select.
What is my error?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---