Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

show/hide portlets in portal

Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to show/hide(personalise) portlets in portal page?

In my portal page there are two portlets.Initially when portal page loads only portlet should appear. when i click some button in first portlet , the second portlet should show up in the portal page?

Please clarify !!
[ September 01, 2006: Message edited by: Bear Bibeault ]
author and cow tipper
Posts: 5000
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow Dude. You have no idea how big a question you just asked!

To answer you're question, it'd be great if we knew why you were doing this, as opposed to how. Why two portlets? Can your objective be achieved with just one. For the second portlet, is there anything that can be displayed before the first portlet has interacted with it?

If the question is about inter-portlet communication, then there are a few approaches. Jetspeed allows portlet messaging, JSR-168 provides a shared PortletSession, which might be helpful, and WebSphere Portal Server provides C2A, or click-to-action, which is great for interportlet communication.

But that assumes your challenge is inter-portlet communication. I think your challenge is hiding a portlet on a page. That now goes to skins and themes, which is a whole other ball of was, and is very difficult to control with a Portlet.

One trick I used when I wanted an 'alert' portlet on a page, was to create a n inivisible skin, and render no content in the alert portlet. It would be inisible on the page unless we delivered alert content. It was a big of a hack, but it worked.

One challenge with working with Portal is seeing your applications as portlet, and not simply Struts or Servlet applications running inside of a Portlet window. The Portal requires a complete mind-shift in delivering applications. It's a tough shift to make, but when you make it, envisioning your applications becomes easier.

By the way, I've got a bunch of free multimedia tutorials about developing Portlets on my website. Check them out if you're new to developing JSR-168 Portlets, especially if you're using WebSphere 5.0 or 5.1.


navat venu
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi kameron,

Thanks a lot for the reply.

I got the anwer to the question i raised .
I will explain again the problem and answer as how i achieved it.

In my case,I have a portal page.And two portlets on it.The first portlet is
a search window.When i give some search info and press search button,the the second portlet which is hiding should appear with search results.

The concept i used is "backing file".This file is simply a java file.
If we attach this backing file to the second portlet.Then before rendering the second portlet, the java file is executed.In the java file as per the value set by first portlet,i can make the second portlet show or hide.
I am using weblogic portal8.1 SP5.

the backing file i used is :

public class MyBackingFile extends AbstractJspBacking

public boolean preRender(HttpServletRequest request, HttpServletResponse response)
PortletBackingContext context = PortletBackingContext.getPortletBackingContext(request);
System.out.println("**inside backing file**");

if(request.getSession().getAttribute("NAVIGATION_KEY") == null)
else {
return true;

return false;

I am new to the portal development,but i m a quick learner.
straws are for suckers. tiny ads are for attractive people.
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic