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.
To correct the eclipse error I had to insert
@(productForm: play.data.Form[Product])
instead of:
@(productForm: Form[Product])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With