I am working on a project on JSF2.0
Here is my code
CountBean.java
count = 1;
function increase() {
this.count++;
}
function decrease() {
this.count--;
}
count.xhtml
<ui:Fragment rendered="#{countBean.count > 100}">
<h:commandButton id="submit-button" value="increase" action="countBean.increase"/>
</ui:Fragment>
<ui:Fragment rendered="#{countBean.count > 0}">
<h:commandButton id="submit-button" value="decrease" action="countBean.decrease"/>
</ui:Fragment>
I run the application and open 2 tabs on Chrome
tab1: 2 buttons increase and decrease is showed. Execute button "decrease" and then switch to tab2
tab2: 2 buttons increase and decrease is showed. Execute button "decrease"
On tab1, the function decrease is run
When performing the submit button in tab2, the page is reloaded and only the increase button is displayed, the decrease function is not run
Instead of the page being reloaded, I want to throw an exception for handler, please help me
Thanks for your support