掲示板

Page to page IPC in LiferayFaces+primefaces

thumbnail
10年前 に Muhammed Shafeek V によって更新されました。

Page to page IPC in LiferayFaces+primefaces

Regular Member 投稿: 140 参加年月日: 13/07/22 最新の投稿
Hi,
I am working IPC in liferay faces. My events seem to work fine if the publishing portlet and the receiving portlet are on the same page, but I would like to place those portlets on different pages. I want to there is an option to automatically switch the page and also pass an integer if such an event is fired.

If there is an option How do I do that using Liferay?

Using: Liferay Portal Community Edition 6.1.1 CE

Please help me sir,
thumbnail
10年前 に Vernon Singleton によって更新されました。

RE: Page to page IPC in LiferayFaces+primefaces

Expert 投稿: 315 参加年月日: 13/01/14 最新の投稿
Muhammed Shafeek V:
I want to there is an option to automatically switch the page


Hi Muhammed,

There is a Liferay Faces demo that was made just to show this case. I would like to invite you to try and look at this demo which uses two portlets called Customers and Bookings. The Customers portlet will give you instructions showing you exactly what to do. It allows you to check a box if you would like a redirect when the event fires, and then you can select the page you would like the redirect to go to. There are some properties that you need to set in your portal-ext.properties file to do this, but there is a note right in the Customers portlet that shows you exactly what you can cut and paste into your portal-ext.properties file to do this. It says,

[indent]NOTE: The following settings must be set in portal-ext.properties in order for redirection to work:
portlet.event.distribution=layout-set
layout.default.p_l_reset=false
tags.compiler.enabled=false[/indent]

See the attached screenshot of the working demo.
I just tested it and it is still working in our latest release :-)

Hope that helps,
Vernon
thumbnail
10年前 に Muhammed Shafeek V によって更新されました。

RE: Page to page IPC in LiferayFaces+primefaces

Regular Member 投稿: 140 参加年月日: 13/07/22 最新の投稿
Hi Vernon,
Thank you for your replay. But its not working for me. I configured all the properties in portal-ext.properties. In my project when the event was fired I got an Illegal state exception.

public void showImage() {
logger.info("inside showImage() ");
Map<String, String> params = FacesContext.getCurrentInstance()
.getExternalContext().getRequestParameterMap();
String navigationId = params.get("selectedContentId");
logger.info("selectedContentId :" + navigationId);
QName qName = new QName("http://liferay.com/events",
"ipc.navigationIdSet");

ExternalContext externalContext = FacesContext.getCurrentInstance()
.getExternalContext();
ActionResponse actionResponse = (ActionResponse) externalContext
.getResponse();
actionResponse.setEvent(qName, navigationId);

try {
externalContext
.redirect("http://localhost:8080/web/tourfilla/calendar");

} catch (IOException e) {
e.printStackTrace();
}

} This is my method for firing event. when the event fired i want to navigate my page from home page to another page named "abc". but its not working.


externalContext
.redirect("http://localhost:8080/web/tourfilla/abc); I know this code block make an exception for me, but my portlet are in different page so i think i want to use that. help me, my project is stuck up now because of this use case..



please help me..
thumbnail
10年前 に Vernon Singleton によって更新されました。

RE: Page to page IPC in LiferayFaces+primefaces

Expert 投稿: 315 参加年月日: 13/01/14 最新の投稿
It seems reasonable that if the demo portlets are working in your environment, then we will be able to get your code working there too.
So, did you try deploying the Customer and Bookings portlets in your environment?

Experience tells me that this will be a quick way to make sure we are on the right track.
And make sure that they can redirect to the page that you are trying to redirect to.

You will feel better about working on your code after seeing our open source code working in your install.
Let's make sure that the Customers and Bookings portlets are working for you before we try to modify your code at this point.