+ Start a Discussion
Akshay GuptaAkshay Gupta 

Java Script Remoting Data from another controller method

Hi Guys,

We have two visual force pages say A and B , and two controllers say controller1 and controller2 in controllers we are using java script remoting methods
both page display different data based on Logged in user and user's inputs.
My reqirement is the need to display data on page A (via come click event under java script ) and corrseponding method to fetch data exists in controller2.
What is the best possible way to fetch data on page A from controller2 via javaScript remoting.

Thank you,
Akshay
SalesFORCE_enFORCErSalesFORCE_enFORCEr
You can define multiple custom controllers or extensions on a vf page so in your page A, in the controllers attribute set controller1, controller2 and then you can use methods from controller2.
Akshay GuptaAkshay Gupta
@ SalesFORCE_enFORCEr- Agreed, but It will inherit all the methods and logic from controller2, I just want to call one method only from controller 2 in pageA using JS remoting..
and controller 2 also receives data from Page B to make  work that method properly..
SalesFORCE_enFORCErSalesFORCE_enFORCEr
What happens if you call the method from Controller2 directly from PageA through remoting?