FilteringSelect在html文件中能显示下拉项,但放在jsp文件中就无法弹出。FilteringSelect的创建代码如下:
var mem = new Memory({ idProperty:"key", data:[ {key:"6",name:"jut1"}, {key:"7",name:"jut2"}, {key:"8",name:"jut3"}, {key:"9",name:"jut4"}, {key:"5",name:"jut5"} ] }); var s = new FilteringSelect ({ placeHolder : "请输入名称", required : false, disabled : false, store: mem, queryExpr : "*${0}*", labelType : "text", autoComplete : false, autoWidth : true, highlightMatch : "all", searchAttr: "name", style: {width: "180px"} },"div_edit"); s.startup();
观察jsp页面的FilteringSelect加载后,在Firefox下输出queryExpr属性值,该值发生了改变,*${0}*变成了*0*;而html页面的queryExpr属性值没发生改变。原来是由于jsp会自动解析EL表达式,而dojo的*${0}*用法符合EL语法,从而被错误解析。解决办法,就是禁止EL表达式解析:
<%@page isELIgnored="true" %>