Skip to main content
Hi,

I am creating a VF page for SF1 application using HTML and apex components. Currently whenever we need to call controller method, all form data get submitted to the backend which increases network latency. To avoid that I was trying to implement Java script remoting. With Java script remoting, I found that we can't use controllers variables which stores previous values. The only option we have to use those values, return the values to the JS callback function and pass it back to remoteAction method as a parameter, which is increasing load on my SF1 application. Do we have better way to do this? Because I need to store Map<string, WrapperClass> as well as List and sObject record and above solution is not looking perfect to me.

Thanks for your help.
2 respuestas
  1. 27 oct, 02:12

    I also have the same question about accessing controller variables when using JavaScript remoting in a Visualforce page. I understand the problem with submitting the entire form every time a controller method is called, especially when the application needs to respond quickly and network latency is already an issue. JavaScript remoting seems like a useful way to reduce unnecessary form submissions, but having to return previously stored values to the JavaScript callback and then pass them back into another remote action can make the implementation more complicated. This becomes even more challenging when the controller maintains complex data structures such as maps containing wrapper classes, lists, and sObject records that need to remain available across multiple operations. 

     

    Has anyone found a cleaner approach to maintaining or accessing this controller-side state while using JavaScript remoting? I am particularly interested in whether there is a recommended pattern that avoids repeatedly transferring large amounts of data between Apex and JavaScript while still keeping the application responsive. It would also be helpful to understand the limitations of JavaScript remoting in this situation and whether a different approach would work better for preserving complex objects between calls. In a similar way, tools such as Gamepad Tester Free can help users check controller inputs directly without unnecessary complexity. If someone has handled a similar scenario in a Salesforce1 application, I would appreciate hearing how you managed the controller variables without increasing network traffic unnecessarily. Perfectly stated here as well gamepadtesterfree.com

0/9000