Full page refresh in Icefaces 1.8.2?
Icefaces only refreshes the changed p开发者_运维百科arts 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);");
精彩评论