java,dictionary,playframework,scala-template
I've got it almost completely working now ... altough I dont completely understand how: My button in the view-class, now without any parameter <a href="@routes.Application.sendMap()"><button class="btn btn-default" type="button">Absenden</button> My controller-class now correctly puts another fake question/answer pair into the map and then returns it with the changed map to the...
playframework,internationalization,playframework-2.3,scala-template
The closest thing I find that, I put a method in acontroller that get lang() then get if its RTL or LTR then load the CSSs and JSs accoding to that from my main.scala.html. so that I shouldn't be worry about passing the if statement from every controller method, the...
playframework,playframework-2.0,scala-template
Ok .. it was to simple :-). Next day, next try. I added the attribute to the object "analysis.name" and that was the solution. It can be handled such like the access of the object. @entryControlItem("analysis.name").value ...
javascript,json,playframework,playframework-2.2,scala-template
Solution: @JavaScript(Json.stringify(TaskType.valuesJson())); Explanation: Play use a JavaScript template format for files "*.js", so you need to use @JavaScript rather than @Html. It's clear after understanding how the templates engine works... Sources: Helped to get there: playframework JsValue in HTML Template Helped to get there: Render a Play!Framework2 javascript as template?...
scala,playframework-2.2,scala-template
Each template gets compiled into a class with one method, calling the template is not dynamic but just like calling any other method/function in Scala or Java. Making this dynamic is possible using reflection but you will loose the static type check that ensures that you will get a compiler...
java,scala,data-structures,playframework,scala-template
Just use an inner loop to iterate over the answers (because the value variable will hold the answers to the question of the loop iteration): index.scala.html @import model.Question @import model.Answer @(myMap: Map[Question, List[Answer]]) @for((key, value) <- myMap){ @key.questionText<br> @for(ans <- value){ <p>Possible answer: @ans.answerText</p> } } ...