I use JSF 1.2. I have a view in which I have a h:commandButton with the following action:
#{myBean.saveSomeData}
When I click on the button, I want to save some data and like the data that are saved can change the display of my view, i would like to force hard reload (like a CTRL+F5 in my browser for example) of my page.
To do that, I thought to this code :
public void saveSomeData() {
... Save some data ...
FacesContext context = FacesContext.getCurrentInstance();
String viewId = context.getViewRoot().getViewId();
ViewHandler handler = context.getApplication().getViewHandler();
UIViewRoot root = handler.createView(context, viewId);
root.setViewId(viewId);
context.setViewRoot(root);
}
But when i do that, the tree components of my view is not reloaded.
So, I don't know how to do that reload. Someone would have any idea about the way to do that ?
Thanks by advance for your help.
Sylvain.