• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

About resetting button option in jsf page

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?

 
Saloon Keeper
Posts: 27819
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

reply
    Bookmark Topic Watch Topic
  • New Topic