我有一个任务流,并且有两个像这张图片一样的视图:
我有一个按钮可以去那里,但我不需要单击该按钮。我需要通过调用操作以编程方式重定向到另一个视图。
怎么称呼,因为我是用JSFF做页面的?
如果我使用这种方法:
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();
}
我收到一个错误,例如找不到组件。如果我使用页面模板 ID,我也会收到错误,例如编译器找不到组件。
你有另一种方法来解决这个问题,或者如果我找到错误的组件,你能解决它吗?