im trying to call a bean from a javascript, using a h:commandLink.
i have a commandLink
<h:commandLink action="#{bean.go()}"
styleClass="simple-submit-button" id="uLink">
<f:param name="userId" value="#{param['userId']}" />
</h:commandLink>
which calls my bean.
and want to call this commandLink from javascript, like this:
document.getElementById('uLink').click();
but i m always getting the error: document.getElementById('uLink') is null.
I tried this:
- setting h:commandLink immediate="false" and instead of document.getElementById('uLink').click() i used document.getElementById('uLink').immediate=true;
- usinng h:commandButton instead.
- using document.getElementById('formId:uLink').click();
Has anyone an idea how i get this work?