function showSupCompany() {
var obj = {};
obj.label = ScompanyId.getSelectedLabel();
obj.value = ScompanyId.getSelectedValue();
$.showModalDialog("" + $$pageContextPath + "common/getCompany.do?companyType=G&upId=-8", "请选择", showSelectCompanyCallback, obj, 600, 450, 0);
}
function showSelectCompanyCallback(ret, a, b) {
if (b == 0 || ret[0] == -1) {
ScompanyId.selectItem(a.value, a.label);
} else if (ret == "") {
ScompanyId.selectItem(null, null);
} else {
ScompanyId.selectItem(ret.get("companyId"), ret.get("unitName"));
}
var dataArr = [] ;
var companyId= ret.get("companyId") ;
$.request({
action:"companyIdtoAppid",
params:{
"companyId" : companyId
},
success:companyIdtoAppidComplete
}) ;
}
public void companyIdtoAppid(){
QueryParamList parmas =new QueryParamList();
parmas.addParam("companyId",companyId);
DBTool dbTool=new DBTool();
String sql="select APP_ID from mdm_company_list where COMPANY_ID="+companyId;
Record[] record=dbTool.executeQuery(sql,null);
responseData.setParameter("appId", record[0].getString("APP_ID") );
}
function companyIdtoAppidComplete(response){
debugger
var rec = response.getParameter("appId");//去action中的appid
ajaxform.setValue('appId',rec);
}
jsp中的app名称代码
<hy:formdrop name="appId" id="appId1" title="App名称" dropname="MC.APPNAME" readonly="true"/>