Cyril N.
Cyril N.

Reputation: 39909

Set a specific input fields

I want to make various specific input fields and I followed this tutorial.

I'm using Play 2 with Java in Eclipse.

The problem I'm facing is this line :

@implicitField = @{ FieldConstructor(myFieldConstructorTemplate.f) }
  1. If I define it oustide my template (outside @main("Title"){}), It can't find FieldConstructor.
  2. If I define it inside my template, @implicitField generate a compilation error :

not found: value implicitField.

How can I do?

I'd prefer to define a package since I will have many inputs (text, radio, checkboxes, etc). I like how it has been done here but I have no idea how to make multiple helpers like that that would be automatically used in my templates.

Thank you for your help, I appreciate!

Upvotes: 1

Views: 1018

Answers (1)

biesior
biesior

Reputation: 55798

That's quite common ... mistake :) you need to import helper package first in your template:

@import helper._
@implicitField = @{ FieldConstructor(myFieldConstructorTemplate.f) }

@main("Title"){
    ....
}

Upvotes: 4

Related Questions