1 Reply Latest reply on Dec 24, 2008 5:34 AM by Ilya Shaikovsky

    a4j commandlink onclick event

    Senthil Chidambaram Newbie

      Hi,
      I'm using <a4j:commandLink reRender="ipTable, ip_panel" action="#{inventoryHome.addAnotherIP}"
      value="#{messages.action_add}" onclick="return isValidIPAddress('ipFirstOctet', 'ipSecondOctet', 'ipThirdOctet', 'ipFourthOctet', '#{messages.ValidIP}')">
      </a4j:commandLink>

      It doesn't matter what the return value from the javascript API commandLink is not firing the request. If I specify like this i.e. without calling return in the onclick it fires the request, but I want the request to be fired only if the javascript method returns true.

      <a4j:commandLink reRender="ipTable, ip_panel" action="#{inventoryHome.addAnotherIP}"
      value="#{messages.action_add}" onclick="isValidIPAddress('ipFirstOctet', 'ipSecondOctet', 'ipThirdOctet', 'ipFourthOctet', '#{messages.ValidIP}')">
      </a4j:commandLink>