I was able to get the id of the button but no able to get the outputText id. Please help
<script >
function exButton(){
var remainingValues = document.getElementById("j_id0:j_id5:remaining").value;
if(remainingValues > 0){
document.getElementById("j_id0:j_id5:btn").click();
}
}
function period(){
setInterval("exButton()",50000)
}
</script>
Apex button//
<apex:commandButton id="btn" action="{!CreatePlan}" reRender="CreatePlan, Debug" value="Request Values" status="CreatePlanStatus" onClick="period();" />
Here is the outputfield
<apex:outputPanel id="Debug" layout="block">
<h2>Remaining Values</h2><br/>
<apex:outputText id="remaining" value="{!Debug}"/>
</apex:outputPanel>
outputText
data. Every 50 seconds the exButton function runs again and if the value of theoutputText
is greater than zero, you start yet another timer by clicking the button again and causing another partial postback and a rerender. Is this correct?<apex:actionPoller >
tag if you can. It'll probably simplify the behavior of the page and you won't have to worry about the element ID values in the page before (or after) the rerender takes place.