1.jsp写入下拉框
<li class="activity-box">
<label class="mini-label"><span class="required">*</span>所属活动 :</label>
<div class="mini-combobox" required="true" id="fkActivityId" name="fkActivityId" textName="fkActivityName" textField="name" valueField="id" label="所属活动"></div>
</li>
2.js中引入
mini.get('fkActivityId').setUrl(contextPath + '/district/recruitmentActivity-recruitmentactivity/recruitmentactivity-selected-load-data.html');
3.action(
这个action为关联表的action)
@Action("/district/recruitmentActivity-recruitmentactivity/recruitmentactivity-selected-load-data")
public void baseactivity() {
try {
sendResponseMsg(this.recruitmentActivityService.queryNameVos());
} catch (final Throwable e) {
LOGGER.error("Action:RecruitmentActivityAction Method:basePhenologicalPeriodNames error ", e);
sendFailMsg("", "查询失败!");
}
}
4.service
@Override
public String queryNameVos() {
List<NameVo> nameVos = ((BaseRecruitmentActivityDao) this.dao).queryNameVos();
return GsonUtil.toJsonByDateTime24(nameVos);
}
5.dao
@Override
public List<NameVo> queryNameVos() {
String sql = "SELECT ID id,NAME name FROM base_recruitment_activity WHERE base_recruitment_activity.DICT_DELETED_VALUE=1110040000000002";
return this.iCustomDao.queryBySQL(sql, null, NameVo.class);
}