I have a Shopcart having cartitems(A java Set) which I need to render in my play application template.The shopcart is available at template since the controller action sets it in renderArgs(shopcart).
I would like to display a message telling the user whether the cart has any cartitems .Currently I am doing it like this
...
your cart #{if shopcart.cartItems} has some#{/if} #{else}#no{/else} items
...
This conditional seems a bit convoluted..Is there some tag /extension which can tell if the collection is empty or not?
thanks in anticipation
You could always make a custom template:
Then implement the conditinalMessage template do the logic in your example.
app/view/tags/conditionalMessage.html:
see this page for more details: http://www.playframework.org/documentation/1.2.4/templates