You need to sign in to do that
Don't have an account?
ABORT <apex:commandLink> action
Hi,
I want to abort the Ajax request cause by clicking a commandLink.
I was thinking in something like this....
<script> function startRequest () { alert('startRequest'); } function endRequest () { alert('endRequest'); } function abortRequest () { var currentAjaxPost = ......; currentAjaxPost.abort(); } </scrip> <apex:form> <apex:outputpanel id="fooPanel"></apex:outputpanel> <apex:commandLink action="{!foo}" onclick="startRequest();" oncomplete="endRequest();" rerender="fooPanel"/> <a href="javascript:;" onclick="abortRequest();">ABORT</a> </apex:form>
After clicking on comandLink, while the action is being executed, if I click on ABORT link, I want the ajax request to be cancelled( preventing the endRequest(); function to be called ) .
Any idea??
Thanks
J.
Yes, if i put return false in the onclick of the commandLink like this:
<apex:commandLink onclick="return false;" the link DOESN'T DO the post.
But i want to CANCEL the post (once i click the commandLink and before the oncomplete event)...