You need to sign in to do that
Don't have an account?
Vivek Viswanath
Invoking action function from Javascript
HI
I was trying to call a custom javascript function on click which inturn calls the action function I would like to know if I am doing it right. its not going into my controller function.
This is what I want to do
function save_clicked() // custom function
{
// logic(this part works)
saveOrder();// call to the action function
}
<apex:actionFunction name="saveOrder" action="{!SaveProgramOrderAndItems}" />
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Save and Create Order" onclick="save_clicked"/>
I was trying to call a custom javascript function on click which inturn calls the action function I would like to know if I am doing it right. its not going into my controller function.
This is what I want to do
function save_clicked() // custom function
{
// logic(this part works)
saveOrder();// call to the action function
}
<apex:actionFunction name="saveOrder" action="{!SaveProgramOrderAndItems}" />
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Save and Create Order" onclick="save_clicked"/>
Hi. This looks correct to me. I too am having some problems getting actionFunction to work for me. See this thread: http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=4075&jump=true#M4075
VF page :
<apex:commandButton value="Activate/Lock" id="activeIA" styleClass="btn btn-success activeIA " disabled="{!activeIA}" style="margin-right:10px;" html-data-toggle="tooltip" html-data-placement="bottom" html-data-original-title="Please click activate for activating Integration." />
<apex:actionFunction name="activateInterface" action="{!submitActiveIA}" />
Javascript :
$('body').on('click', '.activeIA', function(e) {
var r = confirm("Once Interface is activated, you cannot make configuration changes until it is unlocked. Do you like to proceed?");
if ( r == false){
return false;
}else{
activateInterface();
return false;
}
});