Hello! When using jsf, is it possible to refresh the current page (or its part) from the java code?
3 answers
Pure jsf
FacesContext.getCurrentInstance().getPartialViewContext().getRenderIds().add("clientId"); If you use PrimeFaces
RequestContext.getCurrentInstance().update("clientId"); If you use OmniFaces
Ajax.update("clientId"); |
If you need to update the current page completely, you can use:
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext(); ec.redirect(((HttpServletRequest) ec.getRequest()).getRequestURI()); - this is not an update but a reloading of the current page - sistus
|
Yes you can. Look here: ICEfaces Component Suite .
|