Hi,
I am noticing a weird javascript error on my page which resembles a dashboard thats updated perodically using the a4j:poll tag and reRender attribute.
Here is what I have in my JSP:
<a4j:region>
<h:form id="dashboard_poll">
<a4j:poll id="flicker" action="#{dashboardBean.readDashboardStats}" interval="30000" />
</h:form>
</a4j:region>
<h:form id="dashboard">
<a4j:outputPanel ajaxRendered="true">
<h:panelGroup>
<h:commandButton id="assignButton" value="Assign" onclick="return validate();" />
<h:commandLink id="assignLink" style="display:none;" action="#{someOtherBean.makeAssignment}" >
<f:param name="assignId" id="assignId" value="112233"/>
</h:commandLink>
</h:panelGroup>
</a4j:outputPanel>
</h:form>
Here is the javascript:
function validate() {
document.getElementById('dashboard:assignLink).click();
return false;
}
The first time page loads and I click the Assign command button, everything works fine....the page transitions occur like clockwork. However if I dont click on anything and allow the <a4j:poll> to rerender the components and then click the button, I get a javascript error with some ridiculous message "Object Expected Line: 1 Char: 1"
I dug through with alerts etc and figured its before trying to call the "clearFormHiddenParams_dashboard('dashboard')" method. I guess this method is included by default for all <h:form> elements.
Has anyone seen something similar.....Am I doing something incorrectly to be seeing this error? Thanks in advance