Skip to content

Instantly share code, notes, and snippets.

@lezi
Created August 18, 2016 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lezi/19d1dbef2ddc641b54da199da3e26cfe to your computer and use it in GitHub Desktop.
Save lezi/19d1dbef2ddc641b54da199da3e26cfe to your computer and use it in GitHub Desktop.
EditableValueHolder evh = (EditableValueHolder) this.uiInput;
evh.resetValue();
FacesContext ctx = FacesContext.getCurrentInstance();
List<String> clientIds = Lists.newArrayList("form:input1", "form:input2");
UIViewRoot view = ctx.getViewRoot();
view.resetValues(ctx, clientIds); // reseta os componentes da lista
<h:commandLink value="Salvar" action="#{bean.salvar}">
<f:ajax render="@form" resetValues="true"/>
</h:commandLink>
<h:commandButton value="Limpar" action="#{bean.reset}" immediate="true">
<f:resetValues render="form:input1 form:input2"/>
</h:commandButton>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment