title: Play Framework and combobox
body: <p>I have two simple entities, one is <strong>Customer</strong> with a basic String as customerName, and <strong>User</strong> with e-mail, password, and one relationship with Customer.</p>
  
  <p>So a user have one customer and it is required. I have one form that i pass to my view:</p>
  
  <pre><code>static Form&lt;User&gt; formUser = Form.form(User.class);
  ...
  ...
  return ok(views.html.user.index.render(formUser, Customer.find.all()));
  </code></pre>
  
  <p>In my view, I use the form helper.
  For example:</p>
  
  <pre><code>@helper.form(routes.Users.newUser()) {
      @inputText(userForm("email"))
      @select(
          field = userForm("customer"),
          customers.map{ c =&gt;
              c.id.toString -&gt; c.customerName
          },
          args = '_label -&gt; "Customer"
  )
      &lt;input type="submit" value="New" /&gt;
  }
  </code></pre>
  
  <p>But on my POST method, i got an <strong>error</strong> on my bindFromRequest, with <strong>"Invalid Value"</strong> for <strong>customer field</strong>.</p>
  
  <pre><code>Form&lt;User&gt; filledForm = formUser.bindFromRequest();
  if (filledForm.hasErrors()) {
      return badRequest(views.html.user.index.render(filledForm, Customer.find.all()));
  }
  User user = filledForm.get()
  </code></pre>