• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Two Portlets in one window?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone!

I've been surfing the Internet the whole day but haven't found a proper answer to my question / problem yet.

Hope you guys can help me: :-)

I have two Portlets A and B. I want Portlet A to display Portlet B in the _same window_ when a user clicks on an URL in Portlet A.
The user can return to Portlet A again by clicking on an URL in Portlet B.

Is it possible to display two Portlets in one window sequentially?

Thanks!
Dennis
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No what you are asking for is completely and totally impossible.

Essentially, you want a user to add a portlet to a page. When they click on a url in that portlet, the portlet then should remove itself from the page entirely, which is actually a portal administrative task, and then, add a new portlet, to the same page, in it's place. Then, when a url in this second portlet is clicked, the portlet removes itself entirely from the page, causing all sorts of administrative steps to happen in the background, and then the new portlet appears. Lets not even get into the fact that when a portlet is removed from a page, all of the PortletPreferences or PortletData information is completely removed. Essentially, you'd have to write your own portal server to make this type of thing possible.

However, maybe your portlet has two JSP pages. When a link in one JSP is clicked, the second appears. When a link in the second JSP is clicked, the first one appears. The flow is managed by the portlet class, which correctly would be acting as a controller. I think this would be easier than trying to completely re-engineer a portal server.

Okay, my response is fairly snide and tongue in cheek. The fact is, with a portlet, you have to shift your mind a bit and think differently. It isn't a JSP/Servlet application anymore. But don't overcomplicate things. Keep it simple.

And just to note, with a live portal, portlets are very, very, very rarely ever added or removed from a page. People tend to get comfortable with their portal, and tend not to change it.

I've got a bunch of tutorials on JSR168 portlet development at my website (Check out my signature links) Please check them out. They might help you get more comfortable thinking in a portlet mindset.

-Cameron McKenzie
 
Dennis Callag
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cameron, thanks for your answer.
I expected already that it won't be possible.

Dennis
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I would recommend if you add other views (in the form of jsps) in the portlet and switch between the views if you like the idea I could help you more
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Heba has a very good point. It is fairly easy to have a class extend GenericPortlet and work as the controller in an MVC framework. Depending upon the PortletRequest coming in, the Portlet can forward to the appropriate JSP.

A fair possibility.

-Cameron McKenzie
 
Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic