Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

About resetting button option in jsf page  RSS feed

 
simranjit singh sandhu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have encountered a problem ,which i dont know how to solve,
whenever i submit my form everything works fine .
but when i submit the empty form all validations works fine and when i refresh this page via browser new form is not rendered it renders the old page with all validation errors still there.
please help me regarding this and also i want to know how to build reset button functionality in jsf ?
and how to clear all values from form after form submit is successfull ?

 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a JSF reset button tag. Use it. It generates an HTML RESET button.

When a form is submitted, the page that the form is on is destroyed, so there's no need to clear it, although since the actual destruction doesn't begin until the new response starts coming in, you might want to forbid multiple submits. Check last week's topics for a discussion on how to handle it.

In the case of an AJAX submit, where the original page is not destroyed, you can refill the form just by making AJAX re-render it. That will cause the current values of the backing bean to be written out to their corresponding form controls.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!