Hello,
I have to Portlets. When I click on a button in portlet A, I want that Portlet B
navigates to a new side. The other examples e.g click a Button and changes text on the other Portlet works fine, but I want to manupulate the navigation.
I tried this code in the ProcessAction-Method of Portlet B class, that's called after clicking on button of Portlet A:
public class PortletB extends FacesPortlet{ .. public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws PortletException, IOException { .... LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY); Lifecycle lifecycle = lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE); FacesContext fc = (FacesContext) this.getFacesContextFactory().getFacesContext(portletSession.getPortletContext(),aRequest, aResponse, lifecycle); fc.getCurrentInstance().getApplication().getNavigationHandler().handleNavigation(fc.getCurrentInstance(), null,"moveit"); ...
<navigation-rule> <from-view-id>*</from-view-id> <navigation-case> <from-outcome>moveit</from-outcome> <to-view-id>/WEB-INF/jsp/MoveMe.jsp</to-view-id> </navigation-case> </navigation-rule>