I want to add +1 every time a method runs, and then show it in an outputText, but this just add another 0 beside the existing one every time the method runs, what can I do to fix this?
BEAN
private int count=0;
//constuctor
public void doSomething(String asnwer){
count++;
...
}
//setters and getters
JSF page
<p:panelGrid id="ver">
<h:outputText value="#{bean.count}"/> //getter for the count
</p:panelGrid>
<p:commandButton value="Japan" action="#{bean.doSomething(japan)}" update="ver" />