Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

play 2: "reference to form is ambiguous" error message in template

I am trying to build a play2 application following code examples from a book: I am stumbling on creating a form template with the following definition: @(productForm: Form[Product])

@main("Product Form") {
<h1>Product Form</h1>
@helper.form(action = routes.Products.save()) {
    <fieldset>
    <legend> Product (@productForm("name").valueOr("new"))</legend>
    @helper.inputText(productForm("wan"), '_label -> "EAN")
    @helper.inputText(productForm("name"), 'label -> "Name")
    @helper.textarea(productForm("description"), '_label -> "Description")
    </fieldset>
    <input type"submit" class="btn btn-primary" value="Save">
    <a a class=btn" href="@routes.Products.list()"> Cancel </a>
    }
 }

I get the following eclipse (I have the scala ide plugin installed)

Multiple annotations found at this line:
    - reference to Form is ambiguous; it is imported twice in the same scope by import play.data._ and 
 import play.api.data._

Should I ignore the message ? play compile runs fine, but I don't get any output from the form.

like image 667
Manu Avatar asked Jan 14 '14 17:01

Manu


1 Answers

To correct the eclipse error I had to insert

 @(productForm: play.data.Form[Product])

instead of:

 @(productForm: Form[Product])
like image 153
Manu Avatar answered Nov 02 '22 17:11

Manu