Im trying to开发者_JAVA技巧 show a list of views for the logged in user. The list consists of the db entities for the user which i can retrieve from them db. Im trying to bind the correct address to the current view. What i would like is a list of views (urls) in the format:
www.mywebsite.com/result?id=105/myTitle
I know I can use SHtml.link but can anyone suggest how I can achieve the desired url? My code is below:
myUserResults.flatMap{userResult =>
Helpers.bind("result", xhtml,
"id" -> userResult.id,
"title" -> userResult.title,
"link" -> {SHtml.link("/result?id="+ userResult.id + "/" +userResult.title) }
)
Managed to work it out. A Request var is needed:
"link" -> {SHtml.link("/result?id="+ userResult.id + "/" +userResult.title, myRequestVar(userResult), Text("Result"))}
精彩评论