function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ryyhryyh 

AJAX (apex:actionFunction) and Controller State?

When an VisualForce AJAX (apex:actionFunction) is invovked does the controller remain in state?

 

Example: Controller is initialized and an sObject is retrieved and saved on a class variable called "obj" . The actionFunction is invoked, would the sObject still be available in the class variable "obj'? 

 

I ran some tests and obj is null but I would figure that it would still be set?

 

Thanks

bob_buzzardbob_buzzard

Yes, actionfunction causes a postback so the viewstate will be used to maintain the controller state.  I've relied on this many times.

 

Can you post your code?