9 votes
Accepted

Apex PageMessages are not displayed when using OnComplete JS for CommandButton

When you specify the oncomplete attribute, VF is going to perform a Javascript AJAX postback rather than a full page post back to Salesforce. In the full page postback scenario, the entire page is ...
Mark Pond's user avatar
  • 22.9k
8 votes
Accepted

how to stop firing oncomplete if save action has errors

The problem is you need to have an updated variable you can use in JS. To do this you need to refresh the block that has the js variable as the merge field is not automagically updated if the value ...
Eric's user avatar
  • 54.1k
3 votes
Accepted

CommandButton oncomplete JS function not firing

The following works in my testing: <apex:commandButton value="Reject (Entry Criteria)" onclick="if(!confirm('Are you sure?')){return false};" action="{!debugSomething}" oncomplete="refreshPage();"...
Eric's user avatar
  • 54.1k
2 votes

error message on oncomplete in visualforce page

This code will work for you. Use notAllow attribute in the javascript function at oncomplete function itself. Visualforce <apex:page controller="myController2"> <apex:pageMessages id="...
Santanu Boral's user avatar
1 vote
Accepted

Visualforce Page - Prevent onComplete With JQuery If Condition Does Not Meet

You need to prevent the default action, as in: function displayMessage(event) { if(...) { event.preventDefault(); // prevents submission of the form } else { ... } }
sfdcfox's user avatar
  • 487k
1 vote
Accepted

attachment pdf loop not working

The Pagerefence does not get the id of your object. See also the answer to this question: How to pass {!Case.ID} to PageReference pdf.getParameters().put('Id', listakta[b].id); Otherwise you will ...
Florian Heer's user avatar
1 vote

Prevent reloading of Page on oncomplete of actionfunction

With a normal button, you want to cancel the original operation: <button onclick="actfun(); return false;">...</button> This will prevent your whole-page-reload scenario.
sfdcfox's user avatar
  • 487k
1 vote
Accepted

error message on oncomplete in visualforce page

Do one thing oncomplete of save button call a javascript function and check if notAllow false then open pop up <apex:pageMessages id="showmsg"></apex:pageMessages> <apex:commandButton ...
Ratan Paul's user avatar
  • 22.6k
1 vote

Call a method on completion of save action on button click?

Oncomplete attribute accepts a JavaScript function. You can use action function or JavaScript remoting if you want to call Apex function from JavaScript. Visualforce code: <apex:commandButton ...
Raul's user avatar
  • 18.7k
1 vote
Accepted

JQuery Datatable renders nested Datatable on Visualforce rerender

Rerendering the <apex:pageBlock /> instead of <apex:datatable /> would solve the nested table issue.
Praveen's user avatar
  • 10.1k
1 vote

JQuery Datatable renders nested Datatable on Visualforce rerender

Try using HTML table instead of apex:datatable.
Ishwar Mete's user avatar
  • 1,492

Only top scored, non community-wiki answers of a minimum length are eligible