You can use the below method to redirect to another view in ADF programatically.
FacesContext fCtx = FacesContext.getCurrentInstance();
public static void redirectToView(String viewId)
FacesContext fCtx = FacesContext.getCurrentInstance();
ExternalContext eCtx = fCtx.getExternalContext();
String activityUrl = ControllerContext.getInstance().getGlobalViewActivityURL(viewId);
try {
eCtx.redirect(activityUrl);
}
}
catch (IOException e) {
e.printStackTrace();
JSFUtils.addFacesErrorMessage("Exception when redirect to " + viewId);
}
}
No comments:
Post a Comment