File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes reset jsf form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "reset jsf form" Watch "reset jsf form" New topic
Author

reset jsf form

pradeep gamage
Ranch Hand

Joined: Aug 03, 2009
Posts: 85

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...


Software Engineer(BSC):SCJP 1.5
(Knowledge is power when applied)
Vijay Tidake
Ranch Hand

Joined: Nov 04, 2008
Posts: 146

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


The important thing is not to stop questioning.Curiosity has its own reason for existing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reset jsf form
 
Similar Threads
put the criteria fields on valuestack when move to another page and get them back on return
Registration with steps
jstl, multiple forms per page and scopes
Struts handling of multi-page form "wizards"
Multiple linked forms (wizard style) and the form's reset method