Lift If LocParam weird behaviour
there is a LocParam
If
in lift framework. I'm wondering how it is meant to work. I have a simple menu of several items like this one:
val scanning = Menu(Loc("scanning","user" :: "scanning" :: Nil,
S ? "scanning",LocGroup("user")))
which works just good, but when I add the If
, there is weir开发者_如何转开发d behaviour. Firstly, the labels that are rendered in the <a>
tag are not correct, they are taken from other Menu
definitions. (Instead of the content of resource key "scanning", I see the contents of S ? "homepage"). Secondly, it just doesn't work, I assume, that the condition should redirect all accesses on /user/scanning to / since the condition is false everytime and it just lets the underlying snippet to render itself as if there wasn't any condition.
val scanning = Menu(Loc("scanning","user" :: "scanning" :: Nil,
S ? "scanning",LocGroup("user"),If(() => false,() => RedirectResponse("/"))))
() => false
That tells lift to never show your menu entry. So what you see is probably a different entry...
精彩评论