wood burning stoves 2.0*
The moose likes Portals and Portlets and the fly likes navigation between the pages in different portlets using JSR286 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "navigation between the pages in different portlets using JSR286" Watch "navigation between the pages in different portlets using JSR286" New topic
Author

navigation between the pages in different portlets using JSR286

Omar Mohaidat
Ranch Hand

Joined: Jan 16, 2008
Posts: 34
Hello everybody,

I am new in JSR 286, I have to portlets and i want to move from page in first protlet to page in the second protlet. how can i do that?

my scenario is: i have menu in a page contains ordered links in the first protlet, when i click on any link i want to view the page that related to this link in other portlet.
(the menu in first protlet and i want to view the pages of these links in the other portlet)

any help please
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

Will both of these portlets live on the same portal page?
Omar Mohaidat
Ranch Hand

Joined: Jan 16, 2008
Posts: 34
yes, all portlets on the same portal page.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

As Guy was insinuation but not actually saying, Portlets form part of a page but do not represent an actual page themselves. If you want to have a page with either PortletA or PortletB then you should have two portal pages and navigate between the two pages in order to show each portlet.
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

There are probably plenty of tutorials out there with examples of how to do it, but the thing to remember is that Inter-Portlet Communication is like communicating with radios... The Sending portlet creates an event which could be accessed by any portlet. The Receiving portlet is written to watch for the specific events that are relevant to it and will monitor those events.

So when someone selects an item on your menu portlet, you'll create a new event with the value of the selected event. The receiving portlet will see the event and get the parameter from it, and display the appropriate information.

David O'Meara wrote:As Guy was insinuation but not actually saying, Portlets form part of a page but do not represent an actual page themselves. If you want to have a page with either PortletA or PortletB then you should have two portal pages and navigate between the two pages in order to show each portlet.


I just asked because I wanted to know if Omar was looking to have the sending link actually navigate the user to a different page, or if it was all on the same page and the link was just going to trigger an action on the receiving portlet. It seems that both portlets will be on the same page and he just wants a selection from one portlet to reflect in the view of another.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

agreed and agreed.
Omar Mohaidat
Ranch Hand

Joined: Jan 16, 2008
Posts: 34
i am trying to do example like this:
in the JSP


my page code class of publishing the event is:


the page code class for the other portlet to proccess event is


this is my protlet.xml




is this ok? or i need to do other thing? because when i tried to run this code, i clicked on the link of the jsp but no action performed and i didn't find Main class instance. (the print statement in the constructor didn't work)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: navigation between the pages in different portlets using JSR286