You need to sign in to do that
Don't have an account?
Controller] Using static variable with Remote action
Hi all!
I hava a controller having Remote action and normal function called by actionfunction.
In my VF, I call actionfunction first, and during this action, I save some value to static variable in Controller.
After then, Call remoteaction from VF and want to use the static variable, but it returns null.
I will show you my code
Any advise for resolving this problem?
Thanks!
I hava a controller having Remote action and normal function called by actionfunction.
In my VF, I call actionfunction first, and during this action, I save some value to static variable in Controller.
After then, Call remoteaction from VF and want to use the static variable, but it returns null.
I will show you my code
global class TestExtension { static String oId{get; set;} public PageReference setoId(){ // called first // some action Oid = something System.debug('oId : ' + Oid); // It shows me value as expected return null; } @RemoteAction global static String bookingInsert(String context){ System.debug('id : ' + oId); // it shows me null return oId; } }
Any advise for resolving this problem?
Thanks!
I find workaround that deliver Oid when BookingInsert call.
So, if you know the reason why it happens, please answer the question.
It will be helpful all including me.