0

I need to disable a button on clicking it but need its action to be triggered from my jsp page. But when disabling the button, the backend call doesnt happen. Please assist. Can i have it set from the client side itself rather than using a bean variable and rendering the disabled attribute based on the bean variable value.

<h:commandButton id="ct1" styleClass="right" value="Follow" action="#{testBB.confirm}" onclick="this.disabled= true;" />

Ann
  • 65
  • 2
  • 8
  • 4
    Possible duplicate of [ not working when disable="true" initially](https://stackoverflow.com/questions/8647315/pcommandbutton-not-working-when-disable-true-initially) or possibly [Action of not getting invoked when “disabled=true” is set](https://stackoverflow.com/questions/20072437/action-of-hcommandbutton-not-getting-invoked-when-disabled-true-is-set) – Nope Jun 06 '17 at 10:00
  • why not use js and set onclick? – divine Jun 06 '17 at 10:01
  • sorry i dint get u – Ann Jun 06 '17 at 11:05
  • i tried using js but still the same issue – Ann Jun 06 '17 at 11:28
  • Can i have it set from the client side itself rather than using a bean variable and rendering the disabled attribute based on the bean variable value. – Ann Jun 07 '17 at 02:23

0 Answers0