I've a aa.jsp that contains a form whose data comes from a bean bb.java that has a handler bbHandler.java .
The form has a "Submit" button to save the form field values to the bean and onward to the SQL table. All pretty standard stuff.
When I first open my app and go to aa.jsp, bbHandler creates an instance of bb, populates the instance with data from an SQL table, then fills in the form fields with data from the bean.
So far so good.
Suppose the user fills out a few form fields then navigates away from the page withOUT submitting then later navigates back to the page - I'd like the user to see all the original values from the bean in the form INSTEAD of seeing the form as the user last left it.
Put another way, I'd like the page to populate the form with data from the bean every time the user navigates to the page . How can I achieve this?
Would it be possible for you to post your code.
However as I understand from the problem described above, I think the answer relies in the scope of the bean and how do you navigate out of your form.
If it is session scope and a commandButton (or commandLink or any component whith similar behavior) is used to do the navigation out of your form with no immediate attribute set to true then you will probably face this problem.
Hany is right. It seems that the problem is with the managed bean scope. check in your faces-config.xml file and check the scope of your bb.java bean. try to put the scope as "request". This will hopefully solves your problem
The woods are lovely, dark and deep, But I have promises to keep; And miles to go before I sleep, And miles to go before I sleep. - Robert Frost