Im using an IBM implementation of JSF and need to disable a command button after it is clicked so that the user can't click it again until the page is refreshed. Doing a this.disabled='disabled' in the onClick event doesnt work because once the button is disabled, the submit button wont submit anymore.
So we thought, we'd make the submit button a regular button and put some kind of form.submit in the onClick. So we made a clickLink JS fxn and a commandLink with the appropriate action which would be called by the clickLink fxn. the clickLink fxn would in turn be called on the onClick of the command button.
This idea being taken form this page:
Using Javascript with JSF Now the problem is that in this example we're using the Tomahawk JSF commandlink.
<t:commandLink id="hiddenLink" forceId="true" action="register" >
<h:outputText value="tester" />
</t:commandLink>
But if I use the <h:commandLink from the ibm implementation that our architect insists on, it doesnt have the "forceId" property. Without that property being there, The button does get disabled but the form doesnt get submitted.
1. Is this is the most optimal approach to achieve what I want (Disable cmd button after one click, yet submit form)
2. Is it possible to use the regular implementation of commandLink instead of the Tomahawk one and still achieve the same objective?