Moreno Cornaz schrieb:
Hello

I have a page with some input field whose values when I enter the page are taken from a bean (and set in the onLoad of the page). If I insert a value that cause the validation of that fields to fail and than I quit the page, when I come back to that page I found in the fields the values that made the validation failed instead of the values from the bean. I checked out and when i enter again the page after the validation the model (the bean) is correctly set. It seems that jsf keep ther view after the validation instead of restore the new view when I enter again the page. But only if the validation fails!
That doesn't make sense. When you leave a page and then click a link to come back to it, a new view instance will be created so all data that was not successfully pushed into the model (ie which failed validation) *will* be lost. Always. If you're seeing something different, then your webapp must be doing something unusual that you haven't told us about.

Are you perhaps using the browser "back" button? That probably does restore the original view together with invalid input, and that seems to me to be the right behaviour in that case.

What do you mean by "set in onLoad"? There is no "onLoad" functionality in normal JSF...

Regards,
Simon

Reply via email to