//得到投诉来源
public List<CustomManage> getTsFrom(){
return custommanagedao.getTsFrom();
}
dao:
/**得到产品类型**/
public List<CustomManage> getTsFrom(){
return this.find("SELECT distinct new CustomManage(tsFrom,'2') FROM CustomManage C WHERE C.tsFrom IS NOT NULL ORDER BY tsFrom ASC");
}
注意:Oracle在java代码里取出重复值与SqlServer不一样,它得使用:
SELECT distinct new CustomManage(tsFrom,'2') FROM CustomManage C WHERE C.tsFrom IS NOT NULL ORDER BY tsFrom ASC
//投诉信息来源信息级联
function getTsFromDescribe(ts_describe){
var tsfrom = $("#t_tsfrom").val();
var tstsFrom = $("#ts_tsFrom").val();
Ext.Ajax.request( {
url : '${ctx}/complaints/complaints!getTsFrom.action',
params : {
tsfrom : tsfrom//通过json形式将前台每次获取到的值传递给后台
},
success : function(response) {
var json = Ext.util.JSON.decode(response.responseText);
if (json.success) {
var data = json.<strong>cmList</strong>;
if ("" == data) {
alert("请选择投诉类型");
inputForm.t_tsfrom.focus();
$("#ts_tsFrom").empty();//每次需要将上一次的数据进行清空
} else {
$("#ts_tsFrom").empty();
//对获取到的数据进行迭代
for ( var i = 0; i < data.length; i++) {
var id = data[i];
var name = data[i];
$("#ts_tsFrom").append(
"<option value='" + id + "'>" + name + "</option>");
}
dwr.util.removeAllOptions('tstsFrom');
dwr.util.addOptions('tstsFrom', data);
}
}
}
});
}