Try to use 'document.getEl ementById(("for m11.cl1")' to get commandLink 'cl1'
Get null return.
How can I make getElementById to find 'cl1'?
//---source code:---
<f:view>
<afh:html binding="#{back ing_ViewMonthly .html11}" id="html11">
<afh:head title="Title 1" binding="#{back ing_ViewMonthly .head11}"
id="head11">
<link type="text/css" rel="stylesheet " href="../css/jdeveloper.css"/>
<script type = "text/javascript">
function doSomething()
{ // Do some javascript stuff here
alert("Made it to doSomething");
// get reference to our hidden command link to fire a backing bean method
var hiddenCommandLi nk = window.document .getElementById ("form11.cl1 ");
alert("In doSomething, hcl = " + hiddenCommandLi nk);
// getting back object HTMLFormElement
if (hiddenCommandL ink )
{
hiddenCommandLi nk.fireEvent("o nclick");
}
}
</script>
</afh:head>
<afh:body binding="#{back ing_ViewMonthly .body11}" id="body11">
<af:form binding="#{back ing_ViewMonthly .form11}" id="form11"
inlineStyle="ba ckground-color:rgb(198,2 14,255);">
<af:commandLi nk binding="#{back ing_ViewMonthly .cl1}" id = "cl1"
action="#{backi ng_ViewMonthly. dosomething}"
partialTriggers ="selectOneChoi ceMm" useWindow="true "
text="cl1"/>
Get null return.
How can I make getElementById to find 'cl1'?
//---source code:---
<f:view>
<afh:html binding="#{back ing_ViewMonthly .html11}" id="html11">
<afh:head title="Title 1" binding="#{back ing_ViewMonthly .head11}"
id="head11">
<link type="text/css" rel="stylesheet " href="../css/jdeveloper.css"/>
<script type = "text/javascript">
function doSomething()
{ // Do some javascript stuff here
alert("Made it to doSomething");
// get reference to our hidden command link to fire a backing bean method
var hiddenCommandLi nk = window.document .getElementById ("form11.cl1 ");
alert("In doSomething, hcl = " + hiddenCommandLi nk);
// getting back object HTMLFormElement
if (hiddenCommandL ink )
{
hiddenCommandLi nk.fireEvent("o nclick");
}
}
</script>
</afh:head>
<afh:body binding="#{back ing_ViewMonthly .body11}" id="body11">
<af:form binding="#{back ing_ViewMonthly .form11}" id="form11"
inlineStyle="ba ckground-color:rgb(198,2 14,255);">
<af:commandLi nk binding="#{back ing_ViewMonthly .cl1}" id = "cl1"
action="#{backi ng_ViewMonthly. dosomething}"
partialTriggers ="selectOneChoi ceMm" useWindow="true "
text="cl1"/>
Comment