我正在尝试根据源元素恢复JavaScript中的bean值:
function getValue(actionEvent){
actionEvent.cancel();
var component=actionEvent.getSource();
var id=component.getId();
var substr= id.substr(2,4); //This gives me "l11" for a component
//Now I need the value of the bean variable MyBean.value<substr>
//For this case, I need the value MyBean.valuel11
//If I do something like alert("#{MyBean.valuel11}"); it works
//But I need dynamically
var val = "#\{Main.value" + substr + "\}";
alert(val);
}
但结果显示:
你能帮帮我吗?
提前致谢。
答案 0 :(得分:0)