I am using liferay and jsf. In my portlet I tried to reset after submitting page by setting new values to the backing bean. I got blank fields but when I refreshed the page, I got my old values again which I have submitted earlier and it submit again with old values.
I tried to get new viewroot but it also gave me same result.
public void reset(AjaxBehaviorEvent event){
FacesContext context = FacesContext.getCurrentInstance();
Application application = context.getApplication();
ViewHandler viewHandler = application.getViewHandler();
UIViewRoot viewRoot = viewHandler.createView(context, context
.getViewRoot().getViewId());
context.setViewRoot(viewRoot);
context.renderResponse(); //Optional
this.MyBean = new MyBean();
}
P.S. After submit I call this method as reset(null);