I have a "panelGroup" with a render that depends on a boolean variable, and a button that changes the state of that boolean, but when you click on the button, the panelgroup is not updated until you reload the page despite that I DO have an update.
xhtml:
<h:form >
<p:commandButton class="btn" value="mostrar foo"
action="#{developerController.foo}" update="foo"/>
<h:panelGroup id="foo" rendered="#{developerController.bar}">
foo
</h:panelGroup>
</h:form>
My bean:
import java.io.Serializable;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
@Named(value = "developerController")
@SessionScoped
public class DeveloperController implements Serializable {
private boolean bar;
public DeveloperController() {
}
public void foo() {
bar=!bar;
}
public boolean isBar() {
return bar;
}
public void setBar(boolean bar) {
this.bar = bar;
}
}
What should I do to update it?