Re: portlet communication between JSF bridged portlets

Elliot Metsger <[email protected]>
Newsgroups gmane.comp.jakarta.pluto.user
Message-ID <[email protected]>
Hi Nicolas,

Nicolas Kalkhof wrote:
<snip>

> so far everything seems to be smooth but now
> iÅœm at a point where i want to share data between portlets. example:
> user presses a logout button in one portlet and all other portlets
> change their content. how can i get a portlet to do something when i
> klick a submitbutton in an other portlet?

Since the portlet api doesn't define any methods for inter portlet 
communication, you'll need to deal with it on your own.  There are 
probably multiple ways to do this, but the way I've done it in the past 
is to use an application-scoped portlet session variable (or variables). 
  All the portlets monitor the state of the application-scope variable 
and act accordingly.  Ugly, but effective.

> i guess i have to overwrite generic methods like doView() in my own
> class. this method is called, whenever a portlet refreshes, right? 

Thats correct.  If you go the route above - the application-scoped 
portlet session - you'll need some logic in each portlet's doView() 
method which acts according to the value of the session variable.

I'm not familiar with myfaces or jsf bridges so I don't think I can 
offer any advice specific to those technologies.

HTH,
Elliot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.