Close bootstrap modal depending on JSF Bean method return

343 views Asked by At

I have a form inside a bootstrap modal, and I want it to close if the data is succesfully saved, and to keep visible when something goes wrong.

Is there any way to evaluate the bean method return or some bean attribute in order to close or not the modal after submiting the form, without using PrimeFaces?

Below, the code of the submition button:

<h:commandButton class="btn btn-primary" value="Salvar" action="#{estadoBean.salvar()}">
   <f:ajax execute="@form" render=":formLista" />
   <f:passThroughAttribute name="data-dismiss" value="modal"/>
</h:commandButton>
0

There are 0 answers