I want to change color dynamically of commandbutton in Primefaces.
Here's code excerpt of commandbutton:
<p:commandButton id="movieBtn" value="#{kkcIncomingErrorBean.counter}"
type="button" onclick="PF('errorTable').show()"
styleClass="#{kkcIncomingErrorBean.buttonStyle}"/>
buttonStyle is field of kkcIncomingErrorBean class:
private String buttonStyle="background-color:red";
...
public String getButtonStyle() {
return buttonStyle;
}
public void setButtonStyle(String buttonStyle) {
this.buttonStyle = buttonStyle;
}
It is interesting that on update counter variable is updated but buttonStyle is not updated.
Do you have any ideas to fix this?
With regards