[jboss-user] [JBoss Portal] - Click Button on Portlet A , Portlet B navigates to a new pag

ameo do-not-reply at jboss.com
Sun Sep 23 07:49:15 EDT 2007


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"); 
  | ...

Therefor the navigation rule is the following one

  | <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>

That doesn't work! I don't know, if this is the right way, to get the FacesContext from the processAction method of the PortletClass. Is this the right way? Do you have other ideas ?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4087623#4087623

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4087623

More information about the jboss-user mailing list