解决方案 »
- 关于java的一个语法问题
- Spring Security3.0.5 : j_spring_security_check not found HTTP ERROR 404
- 我的简历,欢迎砖头
- http://www.coochong.com/帮我看下这个网站是用什么架构
- jdbcTemplate的问题
- 从源代码生成设计书的问题
- java笔试问题
- JSP页面中如何用嵌入的java代码取到spring配置文件定义的bean?
- Jboss与MYsql的配置问题
- JBuiler中怎么进行模糊查询?
- 求解决java.lang.IllegalArgumentException: id to load is required for loading
- jsf文件上传
@ResponseBody
public String autocomplete(BaseConditionVO vo){
Map<String,Object> map =new HashMap<String,Object>();
map.put("re" , "%" + vo.getQ() + "%");
if (vo.getArg1() != "") {
map.put("actuaMethodId", Long.parseLong(vo.getArg1()));
}
List<TjsActuaMethod> list = tjsActuaMethodService.findListByMap(map);
return JacksonMapper.getListToJson(list);
}-----------------------------------------------------
<tr>
<th type="del" width="60">操作</th>
<th type="autocomplete" fieldClass="required"
name = "tjsActuaMethodList[#index#].fixMethods"
lookupGroup="tjsActuaMethodList[#index#].methodId"
onfocus="onfocus_Autocomplete(#index#)"
size="25"
>维修保养项目</th>
<th type="lookup" fieldClass="required"
name="tjsActuaMethodList[#index#].trueName"
lookupGroup="tjsActuaMethodList[#index#]"
lookupUrl="${ctx}/tjsCarService/lookCheck"
size="25" disabled="true"
lookupPk="wxgrId"
>维修保养工人</th>
<th type="text" name="tjsActuaMethodList[#index#].quotaMins" size="25" disable="true" fieldClass="required"
>维修保养耗时(分钟)</th>
<th type="text" name="tjsActuaMethodList[#index#].warDays" size="25"
>维修保修期限(天)</th>
<th type="text" name="tjsActuaMethodList[#index#].re" defaultVal="" size="25"
>备注</th>
</tr>
--------------------------
<script>
function onfocus_Autocomplete(index)
{
$("input[name='tjsActuaMethodList["+index+"].fixMethods']").autocomplete("${ctx}/tjsCarBrokeMethod/autocomplete", {
minChars : 0, //自动完成激活之前填入的最小字符
mustMatch:true,
matchSubset:false,
extraParams: {},//多个参数
formatItem : function(row, i, max,id,term) {
return getAutocompleteCss(term,row.methodCode,row.fixMethods);
},
formatMatch : function(row, i, max) {
return row.methodCode + row.fixMethods ;
},
formatResult : function(row) {
return row.fixMethods;
}
}).result(function(event, row, formatted) {
if(row != null)
{
$("input[name='tjsActuaMethodList["+index+"].methodId']").val(row.id);
$("input[name='tjsActuaMethodList["+index+"].quotaMins']").val(row.quotaMins);
$("input[name='tjsActuaMethodList["+index+"].warDays']").val(row.warDays);
}
});
}
</script>上面的五张表是举例,就是想问通过B表的信息插入到D表时。C表的B.id根据A表的id查询出来的数据如何自动加入到E表中。前面的功能我已经实现。