Page 1 of 1

Form validation / hide panel

Posted: 25 Feb 2011, 03:51
by guyaofia
I have a panel, that contains a form to enter information for a new product. The panel is hidden until the user clicks add. Then, what should happen is if the form validation fails, the messages component will let the user know *and the panel will stay visible*

The submit button has a "oncomplete=panel.hide() - which is causing the panel to go away even if validation fails. How can I get the panel to stay visible until validation passes and the backing method is executed?

So in other words, user clicks "add", the panel shows. User fails validation - panel stays visible and backing method does not execute, and messages components alert the user. User fills in correct information, backing method is executed, panel.hide() (or some other mechanism) is called, panel disappears.


Thanks!

Re: Form validation / hide panel

Posted: 25 Feb 2011, 09:11
by callahan
This can be achieved using callback parameters. There is an example here: http://www.primefaces.org/showcase/ui/dialogLogin.jsf