+ Start a Discussion
Anand AgrawalAnand Agrawal 

Reducing the number of calls to Server or controller.

Hi Guyz,

 

I am working on Performance Improvement. I need a favour, when I click on Particular button I want some fields to be re-rendered, I cant use the ActionFunction or CommandButton because that makes a call to Server/Controller. and I want to avoid this call.

 

Is there anyway I can re-rendered the salesforce component without making any call to Server/Controller.

 

Thanks in advance,

 

 

Anand Agrawal.

ScoobieScoobie

You could certainly try using the rerender flag on anything that is clicked, it will then automatically rerender the section(s) specified in there. As long as the action attribute is not there it won't call the controller.

WesNolte__cWesNolte__c

Hey

 

You can use JavaScript or a JS framework (jQuery is easy to use and powerful). My question would be if you're rerendering an area on a page what change do you expect to see after the "rerender"? Where is the new data coming from?

 

Wes

Anand AgrawalAnand Agrawal

Thanks for reply,

 

Well I am opening a popup window on click event of Button, that again set some value at the server side which I need to fetch.

 

Anand Agrawal.

Anand AgrawalAnand Agrawal

Hey Scoobee,

 

I cannot use any button to re-render the component coz it will make a call to server which is my intention to reduce. as i mentioned earlier.

 

 

 

WesNolte__cWesNolte__c

But you've also said that you need to fetch the information again for the rerender, so a round trip is unavoidable?

 

Wes

Anand AgrawalAnand Agrawal

so what u mean to say is.. if I rerender some component which is associated with Controller Variable, will take a call a to server.?

WesNolte__cWesNolte__c

Yeah because you need to make a call to the controller to fetch the information. And if you're writing information to the object and want to fetch the new version of that information you'll need to query once again.

 

If you want to get around this you can use JavaScript to create modal windows, and since the "popup" and the page will in reality be the same page you can share the value with other areas of the page using JavaScript and the page DOM.. thereby avoiding the round trip. This is convoluted though and should be avoided.

 

Have a look here: http://wiki.developerforce.com/index.php/Tutorial:_Modal_Dialogs_in_Visualforce_using_the_Yahoo!_User_Interface_Library

 

The AJAX functionality speed is also a slow for my liking and I've tried many, many tricks to make it faster but they're all complex and involve using other technologies.

 

Wes