I'm new to JSF, Primefaces and Ajax, so what i'm trying to do is update one panel if a validation on my back bean is true and update another panel when it's false.
<h:panelGroup id="panel1">
...
<h:commandButton id="btn1" action="#{bean.validate}">
<p:ajax process="panel1" update="panel1"/>
</h:commandButton>
</h:panelGroup>
<h:panelGroup id="panel2">
...
</h:panelGroup>
Back Bean:
public void validate() {
...
if(validatecondition) {
// Update panel 1
} else {
// update panel 2
}
}
So is it possible to do this using ajax? Thanks in advance!!