You need to sign in to do that
Don't have an account?
Ashutosh Limaye 8
Page Reference getContent() method behaving differently when invoked from a JS controller.
Hi,
I have a server side controller which is creating a PageReference object to a page and then calling getContent().toString() on it. This works fine when the method is called from Anynonymous block. The HTML for the desired page is returned in String format.
But when I call this Apex controller's method from the Client side JS controller, the content that is returned is different.
I read that the getContent() method is a callback method and I believe that the method call from the javascript controller is also asynchronous.Could it be that the javascript call back is not waiting long enough for the getContent() to return with the complete HTML?
I have a server side controller which is creating a PageReference object to a page and then calling getContent().toString() on it. This works fine when the method is called from Anynonymous block. The HTML for the desired page is returned in String format.
But when I call this Apex controller's method from the Client side JS controller, the content that is returned is different.
I read that the getContent() method is a callback method and I believe that the method call from the javascript controller is also asynchronous.Could it be that the javascript call back is not waiting long enough for the getContent() to return with the complete HTML?