Form validation / hide panel

UI Components for JSF
Post Reply
guyaofia
Posts: 3
Joined: 25 Feb 2011, 03:44

25 Feb 2011, 03:51

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!

callahan
Posts: 768
Joined: 27 May 2010, 22:52

25 Feb 2011, 09:11

This can be achieved using callback parameters. There is an example here: http://www.primefaces.org/showcase/ui/dialogLogin.jsf

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests