You need to sign in to do that
Don't have an account?

Rerender VF page block after @RemoteAction call
I have a VF page which lists a repeating block of data (a custom object). I can add a new object or delete one. When I add a new one the page displays the newly added object on return from the remote call. When I delete an object however, it does not seem to refresh the page and remove the deleted one.
How do I get it to refresh the page after having deleted something on the page?
This is what my page looks like. When I click on the 'Remove Call Cycle Event' button it runs the Javascript below the image, which calls the @RemoteAction in my controller. What do I need to do for it to remove the block I clicked the button on?

In my VF page:
jCC$(".remCCA").click(function() {
var ccaId = this.id;
if(ccaId != ''){
CallCycleController.RemoveCallCycleActivity(ccaId, function(result, event){
var foo = result;
alert('CallCycle Activity has been deleted');
});
return false;
});
In my Controller:
@RemoteAction
public static void RemoveCallCycleActivity(string remId){
CallCycleActivity__c delCCA = [Select Id, ActivityId__c From CallCycleActivity__c Where Id=:remId];
delete delCCA;
}
How do I get it to refresh the page after having deleted something on the page?
This is what my page looks like. When I click on the 'Remove Call Cycle Event' button it runs the Javascript below the image, which calls the @RemoteAction in my controller. What do I need to do for it to remove the block I clicked the button on?
In my VF page:
jCC$(".remCCA").click(function() {
var ccaId = this.id;
if(ccaId != ''){
CallCycleController.RemoveCallCycleActivity(ccaId, function(result, event){
var foo = result;
alert('CallCycle Activity has been deleted');
});
return false;
});
In my Controller:
@RemoteAction
public static void RemoveCallCycleActivity(string remId){
CallCycleActivity__c delCCA = [Select Id, ActivityId__c From CallCycleActivity__c Where Id=:remId];
delete delCCA;
}
Anyway once remoting is completed ,you have execution control in callback handler method so you can refresh yourpage like below code.
Let us know if it helps you.
Please refer these links as well.
https://www.salesforce.com/docs/developer/pages/Content/pages_charting_refreshing_data_javascript_remoting.htm
All Answers
Anyway once remoting is completed ,you have execution control in callback handler method so you can refresh yourpage like below code.
Let us know if it helps you.
Please refer these links as well.
https://www.salesforce.com/docs/developer/pages/Content/pages_charting_refreshing_data_javascript_remoting.htm
Fantastic! Yes it works. Can you tell me what the 'window.location' refers to? Is it the entire window or just the block from which the call came?
It refers the whole page.
Please mark it as solved and BEST ANSWER if it helps you so others can get help for same issue.
how to change the labels in Account object using visualforce page. please give any ideas.
Use below code to use label on page.
Let us know if it helps you.