2 Replies Latest reply on Jan 26, 2009 3:24 AM by Roland Schöler

    h:commandButton with JS this.disabled=true, never calls ACTI

    Roland Schöler Newbie

      Hi folks, don't know if this is a RichFace Problem or not, but it could be....therefore I aks for your assumptions. I know, that this could also be a MyFace-Problem.....8-}

      Following SRC has a normal h:commandButton, with JS-Code in the onclick-Method. But if,

      this.disabled=true;
      is part of the onClick - JS the action of the Bean will never called, but the rendercycle is going through. I can trace this with PhaseListener in the logfile.

      If I remove the JS-Part
      this.disabled=true;
      from the SRC, then everything works as expected.

      My Environment:
      FF 3.0.5
      RF 3.3.0GA
      MyFaces 1.2.5
      Tomcat 6
      JDK 1.6.0_11

      <h:panelGrid columns="4" rendered="#{articleEditHandler.art.article_number > 0}" styleClass="standardTableBordered" id="button_grid_all">
       <h:commandButton value="#{msgs.button_label_delete}" action="#{articleEditHandler.delete}"
       onclick="this.disabled=true;if(!confirm('#{msgs.js_delete_article}')){this.disabled=false;return false;}alert('show me?');return true" />
      </h:panelGrid>


      thx for your help
      roland
      PS: Type of the button is irrelevant for testing this behaviour