0

I'm developing a project using JSF and Primefaces and I got some forms. Every time I open those forms all fields are already filled with the last information I saved on database. I'd like every time I open those forms all fields were blank. How can I do this? Thank you!!

2 Answers2

1

What Scope are you using in your managed bean? if you are using session scope for example it will hold the last values of your bean properties as long as the application session exists. Depending on what you doing, I would use request scope instead. This will delete the bean when it is not being use and therefore clear the values when you request again. Or perhaps view scope, this will keep the values as long as you are in the same view. Another way would be to use javascript to clear the values by Ids.

JediSal
  • 65
  • 4
0

if u are using

@SessionScoped

Try to change to :

@ViewScoped
Rodik
  • 271
  • 2
  • 19