You need to sign in to do that
Don't have an account?
divya sri 31
how to calculate a number of clicks on a button in visualforce page
Hi All,
i am working on a project where i have a field in my model called count
in my visualforce page if user clicks on a command link then that count must go a set in my model
I have to get the total number of counts in the model
can any one help with this (simple code)
thank u in advs
i am working on a project where i have a field in my model called count
in my visualforce page if user clicks on a command link then that count must go a set in my model
I have to get the total number of counts in the model
can any one help with this (simple code)
thank u in advs
https://developer.salesforce.com/forums/?id=906F0000000BQ69IAG
https://salesforce.stackexchange.com/questions/126128/run-javascript-when-clicking-button-on-vf-page
code
Try this code:
Vf page:
<apex:page controller="Buttonclick_controller">
<apex:form>
<apex:pageBlock>
<apex:commandButton value="click" action="{!countclick}"/> <br/>
Number of clicks= {!countvalue}
</apex:pageBlock>
</apex:form>
</apex:page>
Controller class:
public class Buttonclick_controller {
public Integer count{get;set;}
public Integer countvalue{get;set;}
public Buttonclick_controller()
{
count=1;
}
public void countclick()
{
countvalue=count++;
}
}
Hope this code will help you.Mark it as best answer so that others get help from this too.
Thanks.
Ajay Dubedi
i will try and come back