Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Ingo Schildmann
Primefaces Dialog does not work with multiple portlets
15. November 2012 02:22
Antwort

Ingo Schildmann

Rang: New Member

Nachrichten: 10

Eintrittsdatum: 21. Dezember 2011

Neue Beiträge

Hi,

we use Liferay 6.1.1-ce-ga2 with JBoss 7.1.1 and implement portlets with PrimeFaces 3.4.2 and liferay-faces-portal 3.1.0-ga1

Because we configure the ui at runtime, we use component binding.
With a single portlet we had no problems with showing and hiding PrimeFaces' Dialogs.
But when I have another portlet at a page, the Dialog doesn't work anymore.

I made an example project (build with mvn -Pjboss please).
The portlet "Test data" should show a Dialog when the button "Start" is clicked.
The portlet "Test Menu" just reloads the portlet "TestData" via IPC when "Start" in the "StartMenu" is clicked.

The dialog of "Test data" only works if the portlet "Test Menu is not present.

I'm not sure whether this behavour depends on javax.faces.PARTIAL_STATE_SAVING or whether liferay-portlet.xml is incorrect.

Regards, Ingo
Anhänge: popuptest-portlet.zip (13,2k)
Neil Griffin
RE: Primefaces Dialog does not work with multiple portlets
20. November 2012 10:36
Antwort

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 2178

Eintrittsdatum: 26. Juli 2005

Neue Beiträge

I didn't have JBoss setup, so I tried your portlet with Liferay 6.1.1-ce-ga2 and Tomcat. I had to un-comment the Mojarra exclusions and change the version of liferay-faces-portal to 3.1.1-ga2-SNAPSHOT in the pom.xml tomcat profile in order to get it to build right. It worked OK for me without any problems. Are you saying that this is only a problem when deployed with JBoss AS?
Ingo Schildmann
RE: Primefaces Dialog does not work with multiple portlets
21. November 2012 02:19
Antwort

Ingo Schildmann

Rang: New Member

Nachrichten: 10

Eintrittsdatum: 21. Dezember 2011

Neue Beiträge

Hi Neil, thank you for trying my portlet.
I just installed a new Liferay 6.1 CE GA2 bundled with Tomcat and still have the problem that the popup in "Test data" isn't shown when "Test Menu" is on the same page.

I think I did the same changes to the pom like you did.

My pom.xml (jboss profile removed for brevity):
 1<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 2    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 3    <modelVersion>4.0.0</modelVersion>
 4    <groupId>de.karb</groupId>
 5    <artifactId>popuptest-portlet</artifactId>
 6    <version>0.0.1-SNAPSHOT</version>
 7    <packaging>war</packaging>
 8
 9    <dependencies>
10
11        <dependency>
12            <groupId>javax.portlet</groupId>
13            <artifactId>portlet-api</artifactId>
14            <version>2.0</version>
15            <scope>provided</scope>
16        </dependency>
17
18        <dependency>
19            <groupId>javax.servlet</groupId>
20            <artifactId>javax.servlet-api</artifactId>
21            <version>3.0.1</version>
22            <scope>provided</scope>
23        </dependency>
24
25        <dependency>
26            <groupId>org.primefaces</groupId>
27            <artifactId>primefaces</artifactId>
28            <version>3.4.2</version>
29        </dependency>
30
31        <dependency>
32            <groupId>javax.el</groupId>
33            <artifactId>el-api</artifactId>
34            <version>1.0</version>
35            <scope>provided</scope>
36        </dependency>
37       
38        <dependency>
39            <groupId>log4j</groupId>
40            <artifactId>log4j</artifactId>
41            <version>1.2.14</version>
42            <type>jar</type>
43            <scope>compile</scope>
44        </dependency>
45
46    </dependencies>
47
48    <profiles>
49        <profile>
50            <id>tomcat</id>
51            <activation>
52                <activeByDefault>true</activeByDefault>
53            </activation>
54            <dependencies>
55
56                <dependency>
57                    <groupId>com.liferay.portal</groupId>
58                    <artifactId>portal-service</artifactId>
59                    <version>6.1.1</version>
60                    <scope>provided</scope>
61                </dependency>
62
63                <dependency>
64                    <groupId>com.liferay.faces</groupId>
65                    <artifactId>liferay-faces-portal</artifactId>
66                    <version>3.1.1-ga2-SNAPSHOT</version>                   
67                </dependency>
68               
69            </dependencies>
70        </profile>
71       
72    </profiles>
73
74    <build>
75        <plugins>
76            <plugin>
77                <groupId>org.apache.maven.plugins</groupId>
78                <artifactId>maven-compiler-plugin</artifactId>
79                <version>2.3.2</version>
80                <configuration>
81                    <source>1.6</source>
82                    <target>1.6</target>
83                    <encoding>UTF-8</encoding>
84                </configuration>
85            </plugin>
86        </plugins>
87    </build>
88</project>
Neil Griffin
RE: Primefaces Dialog does not work with multiple portlets
21. November 2012 06:12
Antwort

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 2178

Eintrittsdatum: 26. Juli 2005

Neue Beiträge

Hi Ingo,

I've attached the pom.xml descriptor and the WAR that I built with Maven. Please give them a try on your Liferay+Tomcat bundle. It's working fine on my side -- I can't reproduce the issue.

Thanks,

Neil
Anhänge: pom.xml (4,2k), popuptest-portlet-0.0.1-SNAPSHOT.war (5.047,6k)
Ingo Schildmann
RE: Primefaces Dialog does not work with multiple portlets
21. November 2012 07:38
Antwort

Ingo Schildmann

Rang: New Member

Nachrichten: 10

Eintrittsdatum: 21. Dezember 2011

Neue Beiträge

Hi Neal,

At first your build worked fine but mine still didn't.
Then I noticed that it depends (at least at my tomcat liferay) how I add the portlets, for both builds.

As admin I drag the portlets to place them on the page, then I reload because of the messages "...will only be shown after you refresh the current page."
Now the Start button of "Test data" does not work.
But it does as soon as I move the "Test data" portlet again, and then it works also for non-admins and after restart.

I will now test whether this "workaround" also works for JBoss.

Thanks, Ingo
Ingo Schildmann
RE: Primefaces Dialog does not work with multiple portlets
21. November 2012 10:02
Antwort

Ingo Schildmann

Rang: New Member

Nachrichten: 10

Eintrittsdatum: 21. Dezember 2011

Neue Beiträge

The dialog works also in JBoss after moving the portlet.

Unfortunately this trick doesn't help in our real application, where the creation of the component binding is more complex.

I tried a tiny more complex test portlet, where the button is first rendered, when start has been selected in the menu.
But this also works after the movement of the portlet.

So I have to make the test portlet more and more complex until the dialog doesn't work anymore like in our application.
Until the end of the week I'm out of office, so I will report again next week.

Thanks for the help so far,
Ingo
Ingo Schildmann
RE: Primefaces Dialog does not work with multiple portlets
27. November 2012 09:05
Antwort

Ingo Schildmann

Rang: New Member

Nachrichten: 10

Eintrittsdatum: 21. Dezember 2011

Neue Beiträge

Hi,

the trick wasn't just to move the portlet that contains the dialog, but to move the portlet to the uppermost left position.
I could confirm this in our application.
Of course that's not a satisfying solution to have the menu at the right side.

Neil, could you please check whether at your Tomcat environment the dialog also only works if the "test data" portlet is at the upper left position?

Thanks, Ingo
Neil Griffin
RE: Primefaces Dialog does not work with multiple portlets
27. November 2012 14:55
Antwort

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 2178

Eintrittsdatum: 26. Juli 2005

Neue Beiträge

When both portlets are dragged to the same portal page column, then it works OK. I was able to reproduce the problem if the portlets appear in different portal page columns. The Chrome debugger revealed that the browser started to bombard the server with an infinite loop of Ajax requests.

In the case of two columns (column-1 and column-2), then the only difference that I can think of is that the URL invoked for Ajax requests would have a URL parameter p_p_col_id=column-1 versus p_p_col_id=column-2.

So my recommendation would be that you debug the XmlHttpRequest traffic to see what is causing the infinite loop.

On a side note, is it totally necessary for you to use the binding attribute and do much component creation dynamically via Java? JSF will let you do this of course, but if possible, I would recommend doing as much as you can declaratively in xhtml, using c:if and rendered in order to control the component tree.