WebSphere Portal Server - Passing parameter between Portlet

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > January 2004 > Passing parameter between Portlet





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Passing parameter between Portlet
Calvin

2004-01-19, 2:54 pm

Hi,

Just wondering whether it is possible to pass parameter between separate
portlet. Solution for either passing it from PortletRequest or
PortletSession object would be greatly appreciated.

Thanks,
Calvin


rsoika

2004-01-19, 2:59 pm

If you whant to pass parameter between diferent portlets you have to use Messages.
Send a Messeg in your ActionPerformend Methode :
...

/*** Send a Message... ***/
if(event.getActionString().equals("myURI")) {
getPortletConfig().getContext().send(null, "my message");
....

your can recive your message in a diferent portlet in the
Methode: messageReceived (implement the "MessageListener" Interface!)

public void messageReceived(MessageEvent event) throws PortletException {
// MessageEvent handler
PortletMessage msg = event.getMessage();
// Add PortletMessage handler here
// handel your message...
}
...



Ralph Soika



rsoika

2004-01-19, 2:59 pm

<P>your have to use the Portlet API in a way like this:<BR>
<BR>
&lt;a href="&lt;portletAPI:createURI&gt;&lt;portletAPI:URIAction
name="myURI" /&gt;&lt;portletAPI:URIParameter
name="myKey"
value="&lt;%=myValue%&gt;"/&gt;&lt;/portletAPI:createURI&gt;"&gt;<BR>
<BR>
<BR>
Then you can query your param in the Methode: actionPerformed() <BR>
...<BR>
public void actionPerformed(ActionEvent event) throws PortletException {<BR>
......<BR>
if(event.getActionString().equals("myURI")) {<BR>
System.out.println("MyKey= ....."+(String)event.getRequest().getParameter("nyJey"));<BR>
}<BR>
.......<BR>
</P>
<P><BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</P>


Ralph Soika
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com