wishkres
wishkres

Reputation: 21

View navigation between two different portlets?

I am working on a JSR 286 portlet using JSF 1.2 on WebSphere Portal 7. I have been trying to find a way to do navigation between two portlets on the same page. Essentially:

  1. Click a button on Portlet A.
  2. Portlet B navigates to a different view (based on the information from Portlet A), while Portlet A stays on same view as before.

They are using the same source, so I thought I could accomplish this by using a PhaseListener and the portlet namespace ids -- I have somewhat got this to work, but I can't help but think there has to be a better way to do this.

Before I continue down this route, does anyone know of the proper way for me to do navigation between two portlets?

Upvotes: 2

Views: 720

Answers (2)

Nick Roth
Nick Roth

Reputation: 3077

A common thing I've done to make portlets communicate is using events. In your case, you would setup Portlet A to publish your buttonClick event and setup Portlet B to process the buttonClick event. In Portlet B you would set some render parameter and then use that in the doView to update the UI as needed. You will also need to create a wire between the two portlets.

Here is a link IBM's documentation on portlet communication. There might be some more ideas in there that fit better or give you more to go on.

http://www-10.lotus.com/ldd/portalwiki.nsf/xpDocViewer.xsp?lookupName=IBM+WebSphere+Portal+7+Product+Documentation#action=openDocument&res_title=Portlet_communication_wp7&content=pdcontent

Upvotes: 2

Udo Held
Udo Held

Reputation: 12548

Have a look at the Liferay Faces Portlet Bridge Demos.

The "JSF2 IPC (Events) - Customers" demo is probably what you are looking for. Why are you still using JSF 1.2? You can use JSF 2.0 even when on WebSphere Portal 7 on WAS 7. Just use the Mojorra libs and PARENT_LAST classloading.

Upvotes: 0

Related Questions