Hi,
I'm new to PrimeFaces (coming from IceFaces). I just need a little orientation.
I'm using PrimeFaces 2.2-RC2, Mojarra 2.0.3, EJB 3.1, Glassfish 3.1 and NetBeans 6.9. I have a <p:dialog> with a simple form inside. The data entered are used to add customers to a database. Inside the dialog there is a
<p:commandButton id="btnSaveId" actionListener="#{...}"
onsucess="dlg.hide()" ... />
When the user adds a new customer sucessfully, the dialog hides away as expected. Now, I wonder how can I prevent the dialog closing in case of a problem when executing the actionListener handler. I.e, if the user tries to add a customer that already exists in the database, I catch an exception from the EJB layer and insert a FacesMessage to be shown in a p:messages, but how can I prevent the invocation of "dlg.hide()" (closing the dialog)?
Thank you in advance.
Antonio.
Conditionally Dialog close
- kimausoleil
- Posts: 48
- Joined: 10 Nov 2010, 12:12
- Location: FRANCE
There is an example in showcase. I think this can help you :
http://www.primefaces.org/showcase/ui/dialogLogin.jsf
http://www.primefaces.org/showcase/ui/dialogLogin.jsf
JSF2 - Glassfish 3.0.1 - Mojarra 2.0.4 - PrimeFaces 2.2.1 - Netbeans 6.9.1
There is an example in showcase. I think this can help you :
http://www.primefaces.org/showcase/ui/dialogLogin.jsf
Thank you, I'll check it.
Best regards,
http://www.primefaces.org/showcase/ui/dialogLogin.jsf
Thank you, I'll check it.
Best regards,
-
- Information
-
Who is online
Users browsing this forum: No registered users and 15 guests