Questions tagged [play-templates]

13 questions
2
votes
2 answers

Calling a function as a parameter in a template call in Play

In Play/Scala; I am confused as to why this won't compile: @(tabNames: Seq[String]) @isActive(idx: Int) = { @if(idx < 1) { "active" } else { "" } }
2
votes
1 answer

'Missing parameter type' in Play template

I have the following template defined block in Play 2.4.6 (using scala 2.11.6 and sbt 0.13.8) abd I get a "mising parameter type" on the following code: @property(budgetId: Int, propertyName: String, value: String, shouldEdit: Boolean = false,…
1
vote
0 answers

How to pass Ajax object as parameter on model

I have the following Ajax method, How to I passed the Parameter on Scala model file, Already I googled it but no Use $('#application').on('change', function(){ var x = document.getElementById("application"); var status =…
Udayakumar
  • 167
  • 3
  • 10
1
vote
1 answer

For loop in Play Framework Java

In Play Framework template, I'm trying to iterate between to numbers using for loop. When I use: @for(i <- 2010 to 2015) it works fine. Also, for @for(i <- 2010 to Constants.CURRENT_YEAR) it works correctly (gets predefined constant for…
stijena
  • 419
  • 1
  • 5
  • 15
0
votes
2 answers

Is it possible to pass in a Play! Template as a variable?

I am using Play and I have a simple EmailService class that renders a few objects in a Play template. Here is my code: Content html = views.html.acceptedEmail.render(incomingBlob,relatedBlob,rule); email = new…
daniel9x
  • 629
  • 2
  • 10
  • 25
0
votes
1 answer

Side by side layout for some fields using Play form helper

I am new to Play framework and using play 2.5.2. In some of the pages, I need to display few fields one next to another. For ex: Product name [Text box for product name] Product category [Text box for product category] Price range: from [input box]…
Ano
  • 11
  • 1
  • 1
  • 6
0
votes
1 answer

How to use action as parameter for other action in play 2.0

I've the following function inside a template: @activeLink(currentPath:String) = @{ if(request.path.equals(currentPath)) { "active" } } ( from: Play Framework: How do I change active class on route change ) Now I want to call it…
visil
  • 300
  • 3
  • 6
0
votes
1 answer

Scala Play Framework templating complex objects

I am looking to render some templates and pass in nested objects. I havent seen many examples of this. It compiles, but Im looking more for ideas on how idiomatic the approach is. For example, say the following case classes are built from a Slick…
Azeli
  • 591
  • 5
  • 15
0
votes
1 answer

Working aroung passing an Implicit parameter to every single template

I'm doing some work with PlayFramework templates, but I have encountered a problem. We're using play's helpers which requires Messages (imported from play.api.i18n). Everything was ok until our Designer wanted to have login form in form of Modal...…
Haito
  • 1,919
  • 1
  • 20
  • 32
0
votes
1 answer

Play Framework custom views directory

I found an answer to my question, however implementing it still causes errors. The only difference being the version of the Play framework So, I've created a custom directory within app as follows: app └ custom └ controllers └…
Ryuu
  • 578
  • 1
  • 5
  • 25
0
votes
0 answers

Angularjs Radio Button NO Default Value

I'm new to a project where we're using AngularJS on the front-end and Play Framework Templates to generate the HTML pages. I have some experience with Angular, but I'm new to Play. The problem I'm having is that the radio buttons are automatically…
0
votes
2 answers

F.Promise with Multi Object to Scala Template Play Framework Java

I have two objects bookmark, bookmarks, i want to pass object as parameters to Scala Templates like return ok(views.html.bookmarks.list.render(bookmark, bookmarks)); in F.Promise, public static F.Promise get(final String id) { …
Sivailango
  • 514
  • 1
  • 6
  • 15
0
votes
1 answer

generating html via using helpers

public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) public int id; @Constraints.Required @Constraints.MinLength(1) @Constraints.MaxLength(30) public String firstName; } Using this class I tried to…
Govind Singh
  • 14,083
  • 12
  • 58
  • 94