The below code shows how to programmatically navigate to next jsf page in taskflow. Mainly this is used for conditional navigation i.e., based on some logic we can dynamically decide which page needs to be shown to the user.
Code for navigate() method:
In the above code, 'submit' is the 'action' attribute based on which the next jsff page in the flow will be decided.
public void submitClicked(ActionEvent actionEvent) { navigate(actionEvent, "submit"); }
Code for navigate() method:
protected void navigate(FacesEvent event, String outcome) { RichRegion regionComponent = null; for (UIComponent uic = event.getComponent().getParent(); uic != null; uic = uic.getParent()) { if (uic instanceof RichRegion) { regionComponent = (RichRegion) uic; break; } } if (regionComponent != null) { FacesContext fc = FacesContext.getCurrentInstance(); ExpressionFactory ef = fc.getApplication().getExpressionFactory(); ELContext elc = fc.getELContext(); MethodExpression me = ef.createMethodExpression(elc, outcome, String.class, new Class[] { }); regionComponent .queueActionEventInRegion(me, null, null, false, -1, -1, event.getPhaseId()); } }
Why don't you use a method call activity or (even better) a router) if it is all about directing different users to different views? The approach of using HandleNavigation is not optimal
ReplyDeleteI agree with Frank. If we think about our problem, most of the time we can resolve it by method call activity or router.
ReplyDeletethanks for the post! lot of the flow in my application is happening programmatically. This post helps there.
ReplyDeleteWe have an updated tutorial covering this along with a step-by-step tutorial video at this link - https://www.fireboxtraining.com/blog/2014/11/17/create-navigation-panes-using-menu-model-oracle-adf
ReplyDeleteupdated the method.
ReplyDeletepandora uk
ReplyDeletevans outlet store
adidas yeezy boost 350
true religion jeans
fake rolex
cheap jordans
michael kors outlet
longchamp handbags
tiffany and co
coach outlet
coach factory outlet online
ReplyDeletecoach outlet store
michael kors outlet store
air max 90
coach outlet online
mulberry outlet uk
coach factory outlet online
pandora charms
oakley sunglasses on sale
ray ban sunglasses discount
170511yueqin