1

我正在做一个项目,它有一个 web 服务服务器和 Play!2.0 作为 web 应用程序。两者都与 POJO 模型共享一个 JAR 文件。没有 JPA,没有其他关系。我只是将它们映射到 Mongo 对象。所有字段都是公共的,只有在 toString 上重载以简化调试。

现在我想用从 web 服务加载的对象在 Play 中填写一个表单。

Dispatch preDispatch= patientCardsService.getGetDispatch(name, surname, null);
Form<Dispatch> dispatchForm = form(Dispatch.class).fill(preDispatch);
return ok(patientCard.render(dispatchForm ));

在现场我有这样的东西。

@(dForm: Form[Common.Models.Dispatch ])

@mainMobile("Card") {  

@jqmInput(dForm("status"), "Status")
@jqmInput(dForm("patientData.name"), "Name")
@jqmInput(dForm("patientData.surname"), "Surname")
}

Dispatch 对象当然包含 PatientData 对象,其中包含姓名和姓氏字符串。jqmInput 是一个助手

@(field: Field, label: String, fieldType: Symbol = 'text)
<div data-role="fieldcontain" class="ui-field-contain ui-body ui-br">
    <label for="@field.id" class="ui-input-text" class="ui-input-text">@label</label>
    <input type="@fieldType.name" value="@field.value" name="@field.id" class="ui-input-text ui-body-c ui-corner-all ui-shadow-inset"/>
</div>

这并没有充满对象。我已经检查并填充了填充之前的对象。

有人知道这是什么原因吗?

4

0 回答 0