I have the following code in my scala.html file
@(supports: List[Champion])
<div id="supports" class="champWrap">
@supports.map { champion =>
<a href="@routes.Application.champion(champion.getStringId)">
<div class="icon-wrap">
<img src="@routes.Assets.at(champion.getIcon)" alt="@champion.getName" title="@champion.getName"/>
<p>@champion.getWinm%</p>
</div>
</a>
}
</div>
So at the moment I am gathering a List from the Database in the Controller and sending it to the template when it is rendered.
What I want to change:
I want to have a control option within the page which changes the parameters which are used to gather the list. So after changing the control option, the list has to be gathered with different paramters and the part of the page, which iterates through the list has to be reloaded, also this setting has to be stored, f.ex. if the page is reloaded.
I know that I have to do this with AJAX also have I read in the documentation that something like this is possible in Play:
GET /hotels/list Hotels.list
but I can't quite figure out how I should do this, since I havn`t used Ajax with play before, also could I need some tips on how I should store the setting. I am thinking about doing it with a cookie, is this the right approach?
I would appreciate if somebody could give me some help