• sunny solanki 6
  • NEWBIE
  • -1 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi, 

I have a commandLink on click of which I want to ask the user for confirmation first i.e. whether he is sure to take the action. Once the user says Yes and the action is completed, I want a alert saying that the action was completed successfully. In order to achieve this, I used the onclick and oncomplete attributes of CommandLink. My issue is that if I use both the attributes, my commandLink action never gets fired. If I use only one of the them, everything works fine except I have only one of the popups. 


Is there an issue when both the onclick and oncomplete attribute are used together? Following is a sample code:

 

<apex:commandLink value="Test" action="{!myAction}" onclick="return window.confirm('Are you sure?');" oncomplete="alert('Event Completed');" />