1.在编辑js edit方法中写入
if (id) {
var iframe = this.getIFrameEl();
iframe.contentWindow.PublicinformationManagementEdit.setData(id);
}
2.在 edit js 中写入
setData: function(id) {
var me = this;
if (!id) {
return;
}
$.ajax({
url: contextPath + "/publicinformationManagement/publicinformation-management-detail-load-data.html",
type: 'post',
dateType: 'json',
data: {
id: id
},
success: function(data) {
if (data) {
me.form.setData(data);
me.release();
}
}
});
},
3.action
@Action("/publicinformationManagement/publicinformation-management-detail-load-data")
public void publicInformationManagementDetailLoadData() {
try {
sendResponseMsg(this.publicInformationManagementService.findById(this.id));
} catch (final Throwable e) {
LOGGER.error("publicInformationManagementDetailLoadData - PublicInformationManagementAction error:", e);
sendFailMsg("", "加载失败");
}
}
4.service
@Override
public String findById(Long id) {
Preconditions.checkNotNull(id, "select examinationroom by id but is null");
LOGGER.info("findById - BasePublicInformationManagementServiceImpl info", id);
final BasePublicInformationManagementPojo publicInformationManagementPojo = this.basePublicInformationManagementDao
.get(id);
if (basePublicInformationManagementDao == null) {
LOGGER.info("select BasePublicInformationManagementPojo findById -but not find ExaminationRoom.id info",
id);
}
return GsonUtil.toJsonByDateTime24(publicInformationManagementPojo);
}