You need to sign in to do that
Don't have an account?
Lukesh Karmore
why the code not working
can any one help me to clear the error
Thank you
public class ActionFunctionTest
{
public string myVar{get; set;}
public void showValue(){
myVar='hey Lukesh How are you';
}
}
<apex:page controller="ActionFunctionTest">
<apex:form>
<apex:actionFunction Name="myAction" action="{!showValue}" reRender="out" />
<apex:commandButton value="click me" onclick="myfunction(); result false"/>
<br/>
<apex:outputPanel id="out">
{ !myVar}
</apex:outputPanel>
<script>
function myfunction(){
myAction();
}
</script>
</apex:form>
</apex:page>
Thank you
public class ActionFunctionTest
{
public string myVar{get; set;}
public void showValue(){
myVar='hey Lukesh How are you';
}
}
<apex:page controller="ActionFunctionTest">
<apex:form>
<apex:actionFunction Name="myAction" action="{!showValue}" reRender="out" />
<apex:commandButton value="click me" onclick="myfunction(); result false"/>
<br/>
<apex:outputPanel id="out">
{ !myVar}
</apex:outputPanel>
<script>
function myfunction(){
myAction();
}
</script>
</apex:form>
</apex:page>
Tried your code in my org, I don't see any error
Can you please provide the exact error message you are seeing? Thanks
when i click the button ,didn't get any response.
I suggest taking a look at the following example
In the above visualforce page javascript method in the onclickevent will call the apex controller method with the help of actionfunction.
Apex controller. With the help of actionfunction we can make a call to the apex controller class
I suggest implementing based on this example