You can use `SHtml.link` to build a link that runs a function that sets the
request var appropriately.
A quick example:
val myEntity = currentEntity.is
"a [href]" #> SHtml.link("/url/to/thing", () => currentEntity(myEntity), _)
This will point to /url/to/thing, but append a query parameter that will
ensure that `currentEntity` gets set to its previous value.
The flip side of this is I would suggest trying to structure your URL
such that this isn't necessary, perhaps by having `/entity/id` and using
a Menu.param to look up the appropriate object.
But, if that won't work, SHtml.link should!
Thanks,
Antonio