Friday 26 April 2013

ADF : Redirect to another View Programatically

You can use the below method to redirect to another view in ADF programatically.

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