Skip to content

PrimeFaces Ajax Reset Inputs Not Working for ViewScoped Bean #1877

Closed Answered by melloware
TheMightyE asked this question in PrimeFaces
Discussion options

You must be logged in to vote

Fixed reproducer:
discussion-1877.zip

@TheMightyE it is your misunderstanding. If you look at the Showcase: https://www.primefaces.org/showcase/ui/misc/resetInput.xhtml?jfwid=53569 the beans are @RequestScoped so they are cleared on every request what is being reset is the state of the JSF tree components for ERROR state etc.

Because you are using @ViewScoped it is resetting the value and state when you press clear however its resetting it to the value stored in your backing bean which is @ViewScoped and has a value where @RequestScoped does not.

so if you want this behavior with a ViewScoped bean I suggest your Clear button add ..

<p:ajax update="panel" resetValues="true" listener="#{lib…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@TheMightyE
Comment options

@TheMightyE
Comment options

@melloware
Comment options

@TheMightyE
Comment options

Answer selected by melloware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
2 participants