开发者

List of URL Views / Templates for User in Lift Scala

开发者 https://www.devze.com 2023-03-19 06:22 出处:网络
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 t

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"))}
0

精彩评论

暂无评论...
验证码 换一张
取 消