Questions tagged [scala-template]

71 questions
0
votes
1 answer

How to transfer questions / answers pairs into a view-class in the playframework?

I am trying to fake some question / answer pairs in my controller-class and send them into the view-class via using the playframework. I have the following structure for questions / answers: - Question 1 -- Answer 1.1 -- Answer 1.2 - Question 2 --…
hamena314
  • 2,969
  • 5
  • 30
  • 57
0
votes
0 answers

Play 2 framework Internationalization not working in if statement

I am working with Play 2.3.8. In my views, some of my internationalized messages are not displayed. I suspect a bug in play? The code @play.i18n.Messages.get("calendar.level.0.criterias.title") works perfectly OUTSIDE of the if statement, but not…
0
votes
2 answers

How to prefill a dropdown using scala template and play framework

I am using scala template and Play 2.0 framework for my project. Let's say I have a user form with fields like name (textfield), age (dropdown). While creating the user I filled name as dave and selected age as 25. Now on my edit screen, I want my…
Dave Ranjan
  • 2,966
  • 24
  • 55
0
votes
0 answers

How to inject Scala variable into html attribute in Scala template HTML?

Says, I have a variable @index, and I want to name all the checkboxes with suffix cb_${index} The above syntax didn't work at all. Is this even possible in Scala template or am I…
roxrook
  • 13,511
  • 40
  • 107
  • 156
0
votes
1 answer

Play!2 framework - can't retrieve list from form

I'm trying to POST a bound form that contains a list. This is my scala template code:
0
votes
1 answer

Binding array values in playframework

I have a get some array of inputs from user, say years[], and process the values in my controller. Here is my code: Controller: The controller code tries to bind the form data. In my case, get the array of years value from the html…
user3366706
  • 1,529
  • 3
  • 31
  • 54
0
votes
1 answer

declaration regarding the content variable

I am new playwork. I have been going through the tutorials and samples provided the playframework. I could successfully render helloworld application provided by playframework samples. I have few doubts regarding the rendering part of…
JavaPassion
  • 112
  • 1
  • 1
  • 7
0
votes
1 answer

How do I declare a variable in play template and access it in controller?

I am trying to set a value to a variable in play template and access it in the controller. For ex, in homepage.scala.html, I would like to set a pageName variable a value as "homepage.scala.html". Once I set this value in the play template, I want…
texpert
  • 185
  • 1
  • 3
  • 14
0
votes
2 answers

Dynamically change (@main) name, in Play Framework 2.2.2 (Scala)

I was trying to make the Play layout a bit more dynamic, but didn't know how, any help?? My problem goes like : index.scala.html @(title: String,templateName:String) // templateName is data obtained from a db src, …
mane
  • 1,149
  • 16
  • 41
0
votes
1 answer

Play Framework Template Field value as Object

I would like to access an object which is in a play.api.data.Field. This are the related classes. EntryControl.java @Entity public class EntryControl extends Model { @Id public Long id; public String comment; @OneToMany(cascade =…
couda
  • 31
  • 4
0
votes
1 answer

Scala template: tags with increasing id

I am new to the play framework and scala templates. I have to loop through a map, and create an input tag for each element, with ascenting tag id. So what I want to have in my resulting html is something like the following:
  • jfkint
    • 119
    • 3
    • 13
  • 0
    votes
    1 answer

    How Scala functions work in Play framework 2.1

    I am developing an application with play framework v 2.1 for the views I have to use Scala I was trying to read through one of the sample code of play framework which can be found here http://www.playframework.com/documentation/2.0.x/Samples the…
    Siavosh
    • 2,314
    • 4
    • 26
    • 50
    0
    votes
    2 answers

    Initailzing variable in scala template

    I have a simple code in scala template for Play @( val i = 0){ ....... .... i => i+1; // incremental } But the above code is not working any idea how to fix this ?
    abhig
    • 840
    • 2
    • 12
    • 22
    0
    votes
    1 answer

    Passing a customized object to Scala template

    I have an object profileModel in my profile package and my profile.scala.html file have following code @(model: ProfileModel) when I compiles, it is giving an error recursive value model needs type But when I moved this class to models with my…
    abhig
    • 840
    • 2
    • 12
    • 22
    0
    votes
    1 answer

    .scala.html file reloading again and again

    command prompt showing, [info] Compiling 1 Scala source to /home/winoria/winoria/target/scala-2.10/classes... [info] Compiling 1 Scala source to /home/winoria/winoria/target/scala-2.10/classes... --- (RELOAD) --- [info] Compiling 1 Scala source to…
    user2822316