Message Boards

IPC Events with JSF and redirect on Liferay 7.3.6-ga7 not working

Ramon Garcia, modified 2 Years ago.

IPC Events with JSF and redirect on Liferay 7.3.6-ga7 not working

New Member Posts: 21 Join Date: 2/11/10 Recent Posts

Hi all....

We are trying to migrate our project from Liferay 6.2 to Liferay 7.3.6.... 

Now one of the problems that we have is that it seams that the IPC events does'nt work with redirect....

We update the jsf-ipc-events-bookings-portlet and jsf-ipc-events-customers-portlet from https://github.com/liferay/liferay-faces-bridge-impl/tree/4.2.0 to validate if works with the Neil examples....

We edited the selectionListener method of demo/jsf-ipc-events-customers-portlet/src/main/java/com/liferay/faces/demos/bean/CustomersBackingBean.java like this:

	public void selectionListener(ActionEvent actionEvent) {

		UICommand uiCommand = (UICommand) actionEvent.getComponent();
		Customer customer = (Customer) uiCommand.getValue();
		QName qName = new QName("http://liferay.com/events", "ipc.customerSelected");
		ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
		ActionResponse actionResponse = (ActionResponse) externalContext.getResponse();

		Serializable eventPayload = customer;
		try {
      ThemeDisplay themeDisplay = (ThemeDisplay) externalContext.getRequestMap().get(WebKeys.THEME_DISPLAY);
      Layout layout = LayoutLocalServiceUtil.getFriendlyURLLayout(themeDisplay.getScopeGroupId(),false,"/bookings");
      String redirectPortalPageURL = PortalUtil.getLayoutFriendlyURL(layout, themeDisplay);
      externalContext.redirect(redirectPortalPageURL);
  	}catch (Exception e){
      e.printStackTrace();
  	}

		actionResponse.setEvent(qName, eventPayload);
	}

 And... we deploy jsf-ipc-events-bookings-portlet in bookings page....

When we select a customer in jsf-ipc-events-customers-portlet we are being redirected to bookings page... but the action event is not processed and we only see:

If you select a customer from the Customers portlet, then it will trigger Portlet 2.0 event-based IPC and this portlet will execute a JSF navigation-rule that will cause the bookings.xhtml view to render with the selected customer's bookings.

Some idea??? 

Thanks in advance for all....

Best regards...