You can use the below method to redirect to another view in ADF programatically.
Thanks
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); } }
Thanks
Mahmoud, instead it will be better to use ADF taskflow navigation
ReplyDeletepublic static void navigateTo(String navigationOutcome) {
FacesContext context = FacesContext.getCurrentInstance();
Application application = context.getApplication();
application.getNavigationHandler().handleNavigation(context, null, navigationOutcome);
}
Thank you both. this works fine. How do I open the page in a new window though?
ReplyDeleteHi to open page in new window use dialog framework
ReplyDeleteby setting commndbutton property usewindow true.action property dialog:navigationcase