title: How to bind complex types in play-framework 2.0
body: <p>I have a model class in the following structure:</p>
  
  <pre><code>public class User {
     public String name;
     public Long id;
  }
  
  public class Play {
     public String name;
     public User user;
  }
  </code></pre>
  
  <p>Now i want to have a form based on Play class. So I have an <code>editPlay</code> view which takes <code>Form[Play]</code> as an input.
  In the view I have a form which calls an update action on submit:</p>
  
  <pre><code>@form (routes.PlayController.update()) 
  {..}
  </code></pre>
  
  <p>but I cannot find the right way to bind the user field in a way I'll receive it properly in the controller:</p>
  
  <pre><code>Form&lt;Play&gt; formPlay = form(Play.class).bindFromRequest();
  Play playObj = formPlay.get();
  </code></pre>
  
  <p>According to the <a href="http://playframework.github.com/api/java/play/data/Form.Field.html">API</a>, <code>Form.Field</code> value is always a string. Is there some other way to automatic bind an input to the User Object? </p>
  
  <p>Thanks</p>