I have one taskflow and have two views like this image:
I have a button to go there, but I don't need to click the button. I need to redirect programmatically to another view with calling the action.
How to call it, because I am using JSFF as a page?
If I use this method:
FacesContext fctx = FacesContext.getCurrentInstance();
UIViewRoot root = fctx.getViewRoot();
//client Id of button includes naming container like id of region.
RichCommandButton button =
(RichCommandButton) root.findComponent("cb1");
ActionEvent actionEvent = new ActionEvent(button);
actionEvent.queue();
}
I get an error like can't find the component. If I use page template id I also get an error like the compiler can't find the component.
Do you have another method to solve this, or can you fix it if I get wrong find component?
You have use "URL view" and redirect it to your path :