I don't manage to have a repeated field with selected value according to the data I have in my model.
Currently I have in my User model :
@Required
public String username;
@ManyToMany
public List<Stay> places;
And my Stay model :
@Required
@ManyToOne
public Place place;
@Required
@Formats.DateTime(pattern="yyyy-MM-dd")
public Date startDate;
@Required
@Formats.DateTime(pattern="yyyy-MM-dd")
public Date endDate;
My Scala view form :
@(formUser: Form[User])
...
@repeat(formUser("places"), min = 1) { stayField =>
<div id="groupLocationField">
// Don't manage to reach User->Places->Place
@select(formUser("stayField.places"), options(Place.optionsTitle))
@inputDate(formUser("stayField.startDate"))
@inputDate(formUser("stayField.endDate"))
</div>
}
stayField is a Form.Field type which contains
Field(null,places[1],ArrayBuffer(),None,ArrayBuffer(),Some(Paris Mon Oct 29 00:00:00 CET 2018 Wed Jun 11 00:00:00 CEST 2014 null))
But seems to have convert my Place and Dates into a string. @stayField contains the value of my Stay model toString method.
@stayField.value = Paris Mon Oct 29 00:00:00 CET 2018 Wed Jun 11 00:00:00 CEST 2014
@stayField.value.productArity = 1