1 Reply Latest reply on Aug 10, 2009 8:45 PM by Daniel Yang

    prompt before calling a4j:commandButton action

    chun shin Newbie


      I have an a4j:commandButton and I'd like to stop calling action based on user's answer to my javascript prompt. How I can do that? Before when I was using h:commandButton, I was able to do like

      <h:commandButton onclick="return promptUser();" action=#{myBean.update}" />

      where the promptUser could return either true or false and base on the value returned action was fired.

      I've tried the same thing with a4j:commandButton but it seems the action is fired no matter what. How can I achieve this?

      Thanks in advance,