function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

abort <apex:commandLink>



I want to abort the Ajax request cause by clicking a commandLink.


<apex:commandLink action="{!status}" oncomplete="window.close();" />


how to stop async javascript. if i clcik status my popoup window close if request true or false. how to stop this.





Imran MohammedImran Mohammed

Once the request is made, i dont think it can be stopped.

But you can always put a condition in the apex code, whether the code should execute or not on some condition.

From where are you getting the request value as true or false.


If you are getting the request value from apex controller, then you can have class variable defined that can be used in javascript.


Do you want the window to be closed only if request is true?



I placed below code but this is not working.



Imran MohammedImran Mohammed

Add this in the VF code


    function test()
        if('{!ownerId}' != '')


In VF tag just change the oncomplete to this