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
vinayakamurthy15vinayakamurthy15 

Action:function usage

while using action:function the page is automatically reloading and controller and constructor call is made .. i want to stop reloading how can i do that because once the page reloads the value in the variable resets as null..But i dont want that....

SRKSRK
define a "rerender=" attribute for you action function then it will not reload the page and if u r calling a Javascript on onclick event of a button and then calling your action fucntion from there then you must return flase form your JS function also you must append this on your button " onclick="return youJSFunctionname();" "

<apex:commandbutton onclick="return youJSFunctionname();"/>
digamber.prasaddigamber.prasad

Hi,

 

I assume actioin method in controller is returning null, could you please mark you action method as 'void' type. Something like below:-

 

public void <actionMethodName>(){
   //body of your action method
   // it will not return anything
}

 Let me know if you have any question.

 

 

 

SRKSRK
1) add onclick="return youJSFunctionname();" in your button
2) add rerender=" attribute in action function
3) make you method in controller Void

do ail these 3 steps and i hope your issues get resolve