我有两个这样的模型:
MyModel
public Long id;
public String display;
public List<OtherModel> others;
OtherModel
public Long id;
public String display;
public static HashMap<String, String> listAsOptions() // Returns a list of <Id, Display> items for the select
在我的表格中,我做了一个像这样的选择:
@helper.select(form("others[]"), helper.options(models.OtherModel.listAsOptions), '_label -> "Others", 'id -> "form-others", '_showConstraints -> false, 'class -> "span3", 'multiple -> "multiple")
问题位于此输入的名称,此处为others[]
:它不起作用!
通常,由于我们与其他模型相关,我们应将其映射为others[].id
,但ID也不起作用。
我试过这些(没有运气):
错误取决于名称,但它永远不会有效。
我怎样才能让它发挥作用?