Details
Description
Attached you will find a portle which is a sample that I developed for Liferay Portal that demonstrates inter-portlet communication with ICEfaces Ajax Push.
Although it is only one .WAR, it contains two portlets: Customers and Bookings
To reproduce the problems:
1. Download and Install the Liferay 4.4.2 + Tomcat 6.0.16 bundle
2. Run the bundle, which will create a $HOME/liferay/deploy folder
3. Download the sample-icefaces-ipc-ajax-push-portlet.war attached to this ticket and copy to $HOME/liferay/deploy
5. Start IE7
6. Login as test@liferay.com with password test
7. Position the mouse over the "Welcome" dock in the upper right hand corner
8. Navigate to "My Places > My Community > Private Pages"
9. Add a page named "IPC"
10. Under the "Add Content" menu, expand the "Samples" category
11. Add the "Sample ICEfaces IPC - Customers" portlet
12. Under the "Add Content" menu, expand the "Samples" category
13. Add the "Sample ICEfaces IPC - Bookings" portlet
This isn't reproducible on demand. It often takes a bit of interaction but the basic problem is that if you click on the edit button for one of the customers and then interact with their booking information (open and collapse some panels) and then click on another customer's edit button, the UI is not properly updated. To get the update to occur, you can either:
1) Click on the button again.
2) Wait for the next heartbeat.
Either one of these actions seems to get the updates properly applied to the UI.
Although it is only one .WAR, it contains two portlets: Customers and Bookings
To reproduce the problems:
1. Download and Install the Liferay 4.4.2 + Tomcat 6.0.16 bundle
2. Run the bundle, which will create a $HOME/liferay/deploy folder
3. Download the sample-icefaces-ipc-ajax-push-portlet.war attached to this ticket and copy to $HOME/liferay/deploy
5. Start IE7
6. Login as test@liferay.com with password test
7. Position the mouse over the "Welcome" dock in the upper right hand corner
8. Navigate to "My Places > My Community > Private Pages"
9. Add a page named "IPC"
10. Under the "Add Content" menu, expand the "Samples" category
11. Add the "Sample ICEfaces IPC - Customers" portlet
12. Under the "Add Content" menu, expand the "Samples" category
13. Add the "Sample ICEfaces IPC - Bookings" portlet
This isn't reproducible on demand. It often takes a bit of interaction but the basic problem is that if you click on the edit button for one of the customers and then interact with their booking information (open and collapse some panels) and then click on another customer's edit button, the UI is not properly updated. To get the update to occur, you can either:
1) Click on the button again.
2) Wait for the next heartbeat.
Either one of these actions seems to get the updates properly applied to the UI.
-
Hide
- sample-icefaces-ipc-ajax-push-portlet-4.4.1.1.war
- 4.22 MB
- Deryk Sinotte
-
- META-INF/context.xml 0.2 kB
- WEB-INF/classes/Language_en.properties 0.2 kB
- WEB-INF/classes/.../dao/CustomerUtil.class 2 kB
- WEB-INF/classes/.../CustomerTable.class 5 kB
- WEB-INF/classes/com/.../model/Booking.class 1 kB
- WEB-INF/classes/com/.../model/Customer.class 2 kB
- WEB-INF/classes/.../PortletSessionUtil.class 1 kB
- WEB-INF/classes/log4j.properties 0.2 kB
- WEB-INF/classes/log4j.xml 0.9 kB
- WEB-INF/.../messages-override.properties 1 kB
- WEB-INF/faces-config.xml 1 kB
- WEB-INF/lib/backport-util-concurrent.jar 319 kB
- WEB-INF/lib/el-api.jar 24 kB
- WEB-INF/lib/el-ri.jar 97 kB
- WEB-INF/lib/icefaces-comps.jar 1.68 MB
- WEB-INF/lib/icefaces-facelets.jar 593 kB
- WEB-INF/lib/icefaces.jar 772 kB
- WEB-INF/lib/jsf-api.jar 356 kB
- WEB-INF/lib/jsf-impl.jar 778 kB
- WEB-INF/liferay-display.xml 0.3 kB
- WEB-INF/liferay-plugin-package.properties 0.6 kB
- WEB-INF/liferay-portlet.xml 1.0 kB
- WEB-INF/portlet.xml 2 kB
- WEB-INF/src/Language_en.properties 0.2 kB
- WEB-INF/src/com/.../dao/CustomerUtil.java 2 kB
- WEB-INF/src/.../CustomerTable.java 6 kB
- WEB-INF/src/com/.../model/Booking.java 2 kB
- WEB-INF/src/com/.../model/Customer.java 2 kB
- WEB-INF/src/.../util/PortletSessionUtil.java 2 kB
- WEB-INF/src/log4j.xml 0.9 kB
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Attaching sample portlet showing IPC via Ajax Push between two portlets in the same war.
Show
Deryk Sinotte
added a comment - Attaching sample portlet showing IPC via Ajax Push between two portlets in the same war.
Append (instead of overwriting) new updated views into the shared cookie that holds the list of updated views.
Refactor blocking connection code to send updated views, if available, on newly created requests.
Show
Mircea Toma
added a comment - Append (instead of overwriting) new updated views into the shared cookie that holds the list of updated views.
Refactor blocking connection code to send updated views, if available, on newly created requests.
Using Firebug, I noticed that the when the problem occurs, it appears that the entire lifecycle runs properly and the server-side rendering is applied but the updates that come back on the initial click or incorrect. Following is a snippet from the Firebug console:
window.fE-T#2.async-connection.blocking [9298912] : send asynchronous POST
POST http://localhost:8080/lr-ipc/block/receive-updated-views (17419ms)
[window] Focus Set on [_sample_icefaces_ipc_customers_portlet_WAR_lripc_INSTANCE_05iO_:_id2:_id7:1:_id9]
window.fE-T#2.async-connection.ui [9489420] : send asynchronous POST
POST http://localhost:8080/lr-ipc/block/receive-updates (11ms)
window.fE-T#2.async-connection.ui [9489420] : receive [200] OK
window.fE-T#2 applied update : <script id="fE-TrjKUzJdOM3KNfSkTgQ:2:dynamic-code" type="text/javascript">...</script>
window.fE-T#2.async-connection.ui [9489420] : connection closed
window.fE-T#2.async-connection.heartbeat ping
window.fE-T#2.async-connection.ui [358255] : send asynchronous POST
POST http://localhost:8080/lr-ipc/block/ping (26ms)
window.fE-T#2.async-connection.ui [358255] : receive [200] OK
window.fE-T#2.async-connection.blocking [9298912] : receive [200] OK
window.fE-T#2.async-connection closing previous connection...
window.fE-T#2.async-connection.blocking [9298912] : connection closed
window.fE-T#2.async-connection connect...
window.fE-T#2.async-connection.blocking [482460] : send asynchronous POST
POST http://localhost:8080/lr-ipc/block/receive-updated-views
window.fE-T#1.async-connection.ui [9027713] : send asynchronous POST
POST http://localhost:8080/lr-ipc/block/receive-updates (127ms)
window.fE-T#2.async-connection.ui [6229389] : send asynchronous POST
POST http://localhost:8080/lr-ipc/block/receive-updates (132ms)
window.fE-T#1.async-connection.ui [9027713] : receive [200] OK
window.fE-T#1 applied update : <form action="iceSubmit('sample_icefaces_ipc_bookings_portlet_WAR_lripc_INSTANCE_FdpC:id2');" class="iceFrm sample-icefaces-portlet" enctype="application/x-www-form-urlencoded" id="_sample_icefaces_ipc_bookings_portlet_WAR_lripc_INSTANCE_FdpC:_id2" method="post" onsubmit="return false;">...</form>
window.fE-T#1.script-loader evaluating script : 'sample_icefaces_ipc_bookings_portlet_WAR_lripc_INSTANCE_FdpC:_id2'.asExtendedElement().captureAndRedirectSubmit();
window.fE-T#1.async-connection.ui [9027713] : connection closed
window.fE-T#2.async-connection.ui [6229389] : receive [200] OK
window.fE-T#2.async-connection.heartbeat pong
window.fE-T#2.async-connection.ui [6229389] : connection closed