IPC Events with JSF and redirect on Liferay 7.3.6-ga7 not workingIPC Events with JSF and redirect on Liferay 7.3.6-ga7 not workinghttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1210725522024-03-28T17:01:30Z2024-03-28T17:01:30ZIPC Events with JSF and redirect on Liferay 7.3.6-ga7 not workingRamon Garciahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1210725512021-08-27T15:55:31Z2021-08-25T07:32:46Z<p>Hi all....</p>
<p>We are trying to migrate our project from Liferay 6.2 to Liferay 7.3.6.... </p>
<p>Now one of the problems that we have is that it seams that the IPC
events does'nt work with redirect....</p>
<p>We update the <strong>jsf-ipc-events-bookings-portlet</strong> and
<strong>jsf-ipc-events-customers-portlet</strong>
from https://github.com/liferay/liferay-faces-bridge-impl/tree/4.2.0
to validate if works with the Neil examples....</p>
<p>We edited the selectionListener method of
demo/jsf-ipc-events-customers-portlet/src/main/java/com/liferay/faces/demos/bean/CustomersBackingBean.java
like this:</p>
<pre>
<code class="language-java"> 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);
}</code></pre>
<p> And... we deploy <strong>jsf-ipc-events-bookings-portlet</strong> in
bookings page....</p>
<p>When we select a customer in
<strong>jsf-ipc-events-customers-portlet</strong> we are being
redirected to bookings page... but the action event is not processed
and we only see:</p>
<pre>
<code>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.
</code></pre>
<p>Some idea??? </p>
<p>Thanks in advance for all....</p>
<p>Best regards..