I have a request scoped bean which is filled with various properties from a form. These properties are then used to update another view scoped bean. Now I want to give the user the possibility to the reset the form in such a way that all form fields are holding the values they had when the page was loaded the first time. These values are defined through the bean itself:
@ManagedBean
@RequestScoped
public class ItemSearchBean {
private Rarity minRarity = Rarity.None;
private Rarity maxRarity = Rarity.None;
...
}
Notice though that the form submiting button actually invokes a ajax request, therefor no full page reload goes on.
The submitting button:
<p:commandButton value="Search"
actionListener="#{itemSearchBean.refreshTable}"
update="itemTable,notify"/>
I already tried to use a simple reset button, but it only reseted the form to the last submitted values:
<p:commandButton type="reset" value="Reset"/>
One has to somehow ask the server for a fresh new bean (or prevent it to fill the bean), but I have no clue how to do this.