Here is the relevant vf markup. I am adding the actionfunction next to the button that I want to call it for. I've also put the action function at the very start of my form and end of the form to ensure that is it not the order of the script:
<apex:form id="dealForm" styleClass="deal-form">
<!-- some other markup -->
<div class="slds-grid slds-p-around--medium" id="add-component-btns-container">
<div class="slds-col">
<h2 class="slds-text-heading--medium slds-p-bottom--x-small">Add Opportunities</h2>
<button id="show-digital-form-btn" type="button" class="slds-button slds-button--brand add-component slds-icon-custom-custom27">Digital</button>
<apex:actionFunction name="prepDigitalForm" action="{!prepDigitalForm}" rerender="digitalForm" oncomplete="afterPrepDigitalForm()"/>
<button id="show-print-form-btn" type="button" class="slds-button slds-button--brand add-component slds-icon-custom-custom55">Print</button>
</div>
</div>
<!-- more markup -->
</apex:form>
I have jquery on the page and within my js file I have:
var dealSLDS = {
// a bunch of other functions...
bindButtons: function() {
$('#show-digital-form-btn').on('click', function() {
prepDigitalForm(); // actionFunction
});
},
// other functions
}
$(document).ready(
dealSLDS.bindButtons();
});
The oncomplete javascript actually runs. However, the actual actionfunction does not seem to be executing. I threw an exception as the first line in the method and it still came back just fine. No system.debug messages are in the log either. Any ideas?