In Play Framework (v 2.3.7) (scala 2.11.5) I wish to pass a Call to a twirl template but I won't be able to calculate the params until after the template loads.
The use case is pagination on a table (with constraints and user defined search options). I want to pass a single call to the template and have it "do the math" (much as I'm not a fan of "programming" in a template - I've chosen to keep HTML generation out of direct scala code -- not sure yet if that is a great decision or not...)
The Call will be similar to this:
@routes.AController.list(constraint.id, pageNumber, pageLength)
The args are Long, Int, Int in case that is relevant.
I believe what I need is referred to as a partial function? (I could be way off base here)
How do I pass this to say:
pagination.scala.html
And how would I subsequently call it inside the twirl template?
PS: I have no problems passing fully formed augments to templates -- I just want to wipe the arguments off the argument being passed (man that IS confusing...) and generate those at a later moment in time. Failing that I would have to pass a minimum of four arguments up front which gets ugly really fast.
Of course I wish to make this generic enough to be reusable but I think I can handle that once I understand the mechanics of how to pass the initial augment.