ADF / JavaScript - 动态获取bean变量

时间:2015-07-24 21:43:18

标签: javascript oracle-adf

我正在尝试根据源元素恢复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);
}

但结果显示:

{MyBean.valel11},而不是bean值。

你能帮帮我吗?

提前致谢。

1 个答案:

答案 0 :(得分:0)

我收到了Oracle社区的帮助。 答案是使用clientAttribute

Documentation for clientAttribute

Oracle Community Answer