收录日期:2019/10/18 23:01:47 时间:2009-11-11 01:08:17 标签:java,jsf,icefaces

Icefaces only refreshes the changed parts in the page. In my program I want to do a full page refresh through the manage bean. Does anyone know how to do that ? Thanks.

Doing a page refresh is easy using the ICeFaces API, you can do it in an action or actionlistener for example.

PersistentFacesState.redirectTo(uri);

Where "uri" is an URI. This will enforce a browser redirect and refresh the whole page.

To the point: just fire a normal (synchronous) request instead of an ajaxical (asynchronous) request. No idea how to do it in Icefaces as I never used it, but the basic JSF implementation provides you the <h:form>, <h:commandButton> and <h:commandLink> components for that.

Another approach would be to let JavaScript refresh the page. There is a elegant way to execute JavaScript with ICEfaces.

FacesContext ctx = FacesContext.getCurrentInstance();
JavascriptContext.addJavascriptCall(ctx, "location.reload(true);");