This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reset jsf form

 
pradeep gamage
Ranch Hand
Posts: 85
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my web Application, There is registration application. I am gathering user information from two form(forms are in two different pages ). I have put (registerBean) jsf bean in session scope. when click the next buton in first page second page loaded. after filling the second page form I click submit button. Then user registration data successfully inserted to database. but then open the first page.. "STILL PREVIOUSLY FILL DATA ARE REMAINING" . so i have add following code to clear forms after registration.



then forms are reset. but then after first user registration work fine. On completing a registration and carrying out registration for the second time a null point exception is displayed. give me a idea to resolve this issue or how i can reset forms?

Thanks in Advance...
 
Vijay Tidake
Ranch Hand
Posts: 148
Hibernate Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
One approach could be ,
Put your first bean in a view scope(if you are using JSF2.0)

Then inject the first pageBean into the second pageBean by using ManagedProperty Attribute in faces.config or @ManagedProperty

This will allow you to save all value from second bean into DB and also reset your first and second bean values.

Hope this works and helps
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic